Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Volmarias
Dec 31, 2002

EMAIL... THE INTERNET... SEARCH ENGINES...

Ihmemies posted:

So our software creates charts. Data requests are asynchronous and they return data with metadata to which chart they belong to. If data requests fail, they return no data, only an exception.

So I am now coding a system to run a Service, which runs a Task of periodically checking a list of pending chart requests. If a chart is not generated after n seconds, the task assumes the data requests failed and we did not get the data to create the chart.

It compares timestamps of now and the moment a chart creation request was issued, so it can understand how “old” each chartgen request is.

I asked that would it be possible for the datamanager to return some kind of useful metadata, even within the exception? I was shot down so I am now coding this stupid rear end garbage collection service.

I guess that after enough cases like this it is how spaghetti monster and coding horrors are eventually born..

... Can you not just see that an exception was returned, instead of polling?

Adbot
ADBOT LOVES YOU

necrotic
Aug 2, 2005
I owe my brother big time for this!

Volmarias posted:

... Can you not just see that an exception was returned, instead of polling?

From the sound of it a “bus” of some sort manages the requests and the chartID in the response is how it’s paired back up. No chartID in an error means no match up.

Not doing that approach would be way better, but may not be viable for whatever reason (such as “you have three days to change this”)

But if you can change it away from whatever the hell disconnects requests from their source… yeah do that.

Carbon dioxide
Oct 9, 2012

In the 80s, there was at least one British video game publisher which basically bought games off of kids, slapped some artwork on and started publishing/selling them.

This publisher had absolutely crappy practices, they basically exploited the kids.

Now, there was some 13-yo kid who sent them babby's first videogame. For a project from someone with no experience it was... quite good. Too hard to really be playable, but the graphics were nice for the time and the game ran well.

They asked him to port it to another console. He refused.

So they got some 15-yo kid who had sent in some other games to do it.

Except they never sent this other kid a copy of the source game, he'd basically only seen a demo. And yet they kept badgering him constantly over the deadline they had put in the contract.

At some point he was sick of it and he sat down to write the most unplayable mess of code ever conceived. Just something that vaguely looked like the original game. He sent it to them uncompiled and he called it a day, assuming the publisher would take one look and throw it out.

Nope, the publisher apparently never even tested it and started selling it. They even added it to a collection set a few years later.

https://www.youtube.com/watch?v=PWy_3kMOuMA

This video tells the entire story including a "play" demo and explanation in which ways the game is broken.

Someone also posted the code online and annotated it for our reading pleasure: https://drive.google.com/file/d/0B1lIWldt8I1edUo4ZHBkRXdNVjA/view?resourcekey=0-ZUDlF7nVFbOvTli_Gg0JGw

I suggest watching the vid first, the code might not make much sense without having an idea of what the game was supposed to be.


This kid is a legend.

Volmarias
Dec 31, 2002

EMAIL... THE INTERNET... SEARCH ENGINES...
Absolute magnificence.

Ihmemies
Oct 6, 2012

necrotic posted:

From the sound of it a “bus” of some sort manages the requests and the chartID in the response is how it’s paired back up. No chartID in an error means no match up.

Not doing that approach would be way better, but may not be viable for whatever reason (such as “you have three days to change this”)

But if you can change it away from whatever the hell disconnects requests from their source… yeah do that.

I could not get a comment from anyone from our team, so I took silence as acceptance and just refactored it, took only one day… Now it returns the id and also the requests, which are tagged based on success/failure. It is a bit better now at least. I don’t know how these things are ideally implemented of course.

Xarn
Jun 26, 2015

Carbon dioxide posted:

In the 80s, there was at least one British video game publisher which basically bought games off of kids, slapped some artwork on and started publishing/selling them.

This publisher had absolutely crappy practices, they basically exploited the kids.


Today they are called Roblox and worth billions :v:

Plorkyeran
Mar 22, 2007

To Escape The Shackles Of The Old Forums, We Must Reject The Tribal Negativity He Endorsed
Doesn't Roblox skip the step of paying them actual money, though?

RPATDO_LAMD
Mar 22, 2013

🐘🪠🍆

Plorkyeran posted:

Doesn't Roblox skip the step of paying them actual money, though?

it pays them in "robux", which can technically be cashed for real money but only for around 1/4th the amount it costs to buy robux.

gnatalie
Jul 1, 2003

blasting women into space

Bruegels Fuckbooks posted:

this is what code from programmers who "don't like to be tied down to types" actually looks like in the wild. dynamic and the expandoobject have enabled some really bad c# code.

we inherited an angular+netcore app with plenty of dynamic and any, it was a nightmare.

susan b buffering
Nov 14, 2016

gnatalie posted:

we inherited an angular+netcore app with plenty of dynamic and any, it was a nightmare.

We're in a similar position, minus the dynamic types, but lots of manual JSON touching to make up for it. As I've started converting those to use real types I've learned that the real horror is Snaplogic giving people with a bit of SQL knowledge a low code way to produce some truly bizarre APIs.

Xarn
Jun 26, 2015

Plorkyeran posted:

Doesn't Roblox skip the step of paying them actual money, though?

No, they just make them jump through fuckton of hoops to discourage them from taking the money, and if that fails they get them with lovely exchange ratios.

They aren't lying that it is technically possible to get paid :v:

Ranzear
Jul 25, 2013

https://sadservers.com/

Some of these are great and some of them belong here. Anyone caught messing with raw iptables and then asking why webserver no worky will be launched into the sun.

ultrafilter
Aug 23, 2007

It's okay if you have any questions.


https://twitter.com/defunkt/status/1719421402867204537
Thread

Not strictly coding related, but it absolutely goes here.

more falafel please
Feb 26, 2005

forums poster

ultrafilter posted:

https://twitter.com/defunkt/status/1719421402867204537
Thread

Not strictly coding related, but it absolutely goes here.

I have a coworker who once forgot to check his Perforce environment variables before doing a p4 obliterate on a no-longer-needed depot. We had a depot called rolling_vendor that periodically took merges from Epic's UE3 depot, so that we always had latest to compare against locally. The central tech group had started running their own rolling_vendor, so we didn't need ours anymore. Unfortunately they had just cloned the entire configuration from ours, including permissions, so my coworker apparently had full admin rights, and the obliterate went through just fine. At least it was relatively easy to get back, because there weren't any backups.

He has an Irish last name that starts with an O', so he's been known as O'Bliterate for the last... 17 years

Tequila Bob
Nov 2, 2011

IT'S HAL TIME, CHUMPS

ultrafilter posted:

https://twitter.com/defunkt/status/1719421402867204537
Thread

Not strictly coding related, but it absolutely goes here.

Thanks! The best part of the thread is definitely well after the initial post. It's worth reading the whole thing.

"Don't let anything access production except production."

This is one of those statements that seems so obvious that it should be regarded as a truism. And yet it's so often not the case.

OddObserver
Apr 3, 2009

Tequila Bob posted:

Thanks! The best part of the thread is definitely well after the initial post. It's worth reading the whole thing.

"Don't let anything access production except production."

This is one of those statements that seems so obvious that it should be regarded as a truism. And yet it's so often not the case.

Also "don't work weekends".

Xarn
Jun 26, 2015
"Don't let anything access production except production.", or the generalized variant of "use minimal possible access rights" is indeed very obvious, and yet my team has to keep pushing rest of the company to use read-only accesses where possible, to not just give out rights to the whole file share when only one folder is needed, and to generate write tokens with actual expiration dates, instead of expiring them in year 9999.

The twist is that we are the R&D team :suicide: we should be the ones causing issues by hacking things apart to get results ffs

Volmarias
Dec 31, 2002

EMAIL... THE INTERNET... SEARCH ENGINES...

Tequila Bob posted:

Thanks! The best part of the thread is definitely well after the initial post. It's worth reading the whole thing.

"Don't let anything access production except production."

This is one of those statements that seems so obvious that it should be regarded as a truism. And yet it's so often not the case.

I test in production. Since the tests are in production, they're fine, right? Seems like everyone's making a big deal about nothing!!

Ihmemies
Oct 6, 2012

I have determined that our university’s webdev1 course is pure coding horror. Plain ES5/6 mixed haphazardly, mongodb, age old node packages. I tried to swim against the tide, using ES6 features like modules, and import/export, until a test in this week’s assignments banned them.

[-] /submission/user/src/public/js/adminUsers.js1 problem (1 error, 0 warnings)
4:1 Error Parsing error: 'import' and 'export' may appear only with 'sourceType: module'
[-] /submission/user/src/public/js/cart.js1 problem (1 error, 0 warnings)
4:1 Error Parsing error: 'import' and 'export' may appear only with 'sourceType: module'
[-] /submission/user/src/public/js/products.js1 problem (1 error, 0 warnings)
4:1 Error Parsing error: 'import' and 'export' may appear only with 'sourceType: module'
[-] /submission/user/src/public/js/register.js1 problem (1 error, 0 warnings)
4:1 Error Parsing error: 'import' and 'export' may appear only with 'sourceType: module'

Well, I thought I’d just convert our project to typescript and transpile to ES5.

… the functional programming tester checks for “for” loops, which typescript auto generates when transpiling.

/home/user/study/tuni/webdev1proj/dist/index.js
21:22 error Unallowed use of `for` loop fp/no-loops

/home/user/study/tuni/webdev1proj/dist/models/user.js
21:22 error Unallowed use of `for` loop fp/no-loops

/home/user/study/tuni/webdev1proj/dist/routes.js
21:22 error Unallowed use of `for` loop fp/no-loops

/home/user/study/tuni/webdev1proj/index.js
21:22 error Unallowed use of `for` loop fp/no-loops

/home/user/study/tuni/webdev1proj/models/user.js
21:22 error Unallowed use of `for` loop fp/no-loops

/home/user/study/tuni/webdev1proj/routes.js
21:22 error Unallowed use of `for` loop fp/no-loops

I give up. I am making Internet Explorer compatible webpages with pure ECMASCRIPT 5 in TYOOL 2023. And I don’t have a choice if I want a grade from the course.

gently caress. gently caress this horseshit. 2nd largest uni in Finland btw, don’t come here to get your CS degree.

MrMoo
Sep 14, 2000

Most Samsung and LG TVs still only support ECMAScript 5, there's a whole market out there for outdated tech.

OddObserver
Apr 3, 2009
"no for loops" is a pretty strange rule.

Ihmemies
Oct 6, 2012

OddObserver posted:

"no for loops" is a pretty strange rule.

They want to enforce functional style of programming. So all loops are verboten.

I don’t really care what kind of garbage the typescript compiler spits out. My major problem is that there is no way do the course assignment with anything newer than ES5. At least I can’t figure this out.

Maybe there is a tool which transpiles modern ES to ES5, and doesn’t add loops to the code? :shrug:

necrotic
Aug 2, 2005
I owe my brother big time for this!

Ihmemies posted:

They want to enforce functional style of programming. So all loops are verboten.

I don’t really care what kind of garbage the typescript compiler spits out. My major problem is that there is no way do the course assignment with anything newer than ES5. At least I can’t figure this out.

Maybe there is a tool which transpiles modern ES to ES5, and doesn’t add loops to the code? :shrug:

Just use the methods on the array instead of a for loop and it will transpile to the method calls.

Ima Computer
Oct 28, 2007

Stop all the downloading!

Help computer.

necrotic posted:

Just use the methods on the array instead of a for loop and it will transpile to the method calls.

Given that the lint errors occur on the same line of every file, the for loops are probably part of the boilerplate code that the typescript compiler is inserting to support polyfilling modern JS features in ES5, not the original source code.

Ihmemies posted:

Maybe there is a tool which transpiles modern ES to ES5, and doesn’t add loops to the code? :shrug:

I think every solution that transpiles down to ES5 is probably going to add polyfill code with loops in it. Though, if some ES6 code works, you could probably target at least ES2015 instead of ES5 and possibly avoid the polyfill code altogether.

The first set of errors you got is because your eslint parser isn't configured for esmodules. If you're able to adjust the eslint configuration that's testing your code, then can probably set parserOptions.sourceType to "module" and then just write plain esmodules with import/export syntax without any compilation/transpilation step.

Ima Computer fucked around with this message at 01:52 on Nov 18, 2023

RPATDO_LAMD
Mar 22, 2013

🐘🪠🍆
i would really not recommend turning in transpiled or otherwise machine-generated code for a school assignment
assuming the professor is even the smallest bit competent they will have some level of human-beings-actually-looking-at-the-code (even if it's just TAs) beyond just automatic grading.

ExcessBLarg!
Sep 1, 2001
It's really a privilege to be able to "modern" code. There's so many times when you're stuck with ES5 or Java 8 or C89 even due to aging infrastructure and requirements. And being able to meet those requirements--even if they're ridiculous--is still important.

Also I wouldn't really evaluate a CS program based on their webdev course unless it's required form some reason.

Tei
Feb 19, 2011

Ihmemies posted:

I have determined that our university’s webdev1 course is pure coding horror. Plain ES5/6 mixed haphazardly, mongodb, age old node packages. I tried to swim against the tide, using ES6 features like modules, and import/export, until a test in this week’s assignments banned them.

Academia is usually outdated. The material for the course need effort to be created, and that effort is not dumped every time new stuff appears (that with javascript is every hour of the clock). And sometimes the teachers are people that have never been out in the real world, but instead where students of the matter or come from a connected field, like math.

Ihmemies
Oct 6, 2012

Ima Computer posted:

Given that the lint errors occur on the same line of every file, the for loops are probably part of the boilerplate code that the typescript compiler is inserting to support polyfilling modern JS features in ES5, not the original source code.

It is this.

quote:

I think every solution that transpiles down to ES5 is probably going to add polyfill code with loops in it. Though, if some ES6 code works, you could probably target at least ES2015 instead of ES5 and possibly avoid the polyfill code altogether.

The first set of errors you got is because your eslint parser isn't configured for esmodules. If you're able to adjust the eslint configuration that's testing your code, then can probably set parserOptions.sourceType to "module" and then just write plain esmodules with import/export syntax without any compilation/transpilation step.

I also tried this first, but the linter runs on school’s servers and the config file can not be edited. I asked them to consider allowing modules in the config but got no answer.

Then I tried transpiling, and the linter gave a 0 because of the compiler added for loops.

I understand keeping courses up to date is hard, but it is extremely annoying to be disallowed to use any kind of workarounds.

I have never seen worse spaghetti than the codebase we were given by the course for this project. I have rewritten it from all the allowed parts, and use typescript checks for my plain JavaScript. It has made it somewhat tolerable, but these newest linter tests nearly make me give up this crap :eng99:

RPATDO_LAMD posted:

i would really not recommend turning in transpiled or otherwise machine-generated code for a school assignment
assuming the professor is even the smallest bit competent they will have some level of human-beings-actually-looking-at-the-code (even if it's just TAs) beyond just automatic grading.

They could just look at the /src folder of the git repository. I wish a real human looked at these instead of lovely automated tests. I have spent maybe 20% time on actual productive code, 80% trying to deal with the automated tests and figuring out workarounds for them.

Ihmemies fucked around with this message at 09:27 on Nov 18, 2023

Athas
Aug 6, 2007

fuck that joker
So the webdev course has you working around lovely opaque technical restrictions and outdated server setups?

Ihmemies
Oct 6, 2012

Athas posted:

So the webdev course has you working around lovely opaque technical restrictions and outdated server setups?

Such is life. After this course there are 2 follow-up courses, but I think I will just skip them and do https://fullstackopen.com/en/ + the project instead. I heard everyone complain about the web dev course but I wanted to give it a chance. My own fault…

leper khan
Dec 28, 2010
Honest to god thinks Half Life 2 is a bad game. But at least he likes Monster Hunter.

ExcessBLarg! posted:

It's really a privilege to be able to "modern" code. There's so many times when you're stuck with ES5 or Java 8 or C89 even due to aging infrastructure and requirements. And being able to meet those requirements--even if they're ridiculous--is still important.

Also I wouldn't really evaluate a CS program based on their webdev course unless it's required form some reason.

C89 is a fine language as long as you're single threaded.

Ihmemies
Oct 6, 2012

I’d rather write C89 than ES5, after writing both.

Maybe I need to start looking at C++ front end frameworks.

necrotic
Aug 2, 2005
I owe my brother big time for this!

Ima Computer posted:

Given that the lint errors occur on the same line of every file, the for loops are probably part of the boilerplate code that the typescript compiler is inserting to support polyfilling modern JS features in ES5, not the original source code.

I could’ve sworn Array forEach and friends were around back in ES5. I guess it could be dumbly including a polyfill though even thought it’s not needed for that?

Ima Computer
Oct 28, 2007

Stop all the downloading!

Help computer.

necrotic posted:

I could’ve sworn Array forEach and friends were around back in ES5. I guess it could be dumbly including a polyfill though even thought it’s not needed for that?

It's probably not polyfilling forEach that's a problem, but some ES6+ language feature.

For example, if you use object spreading syntax, it compiles down to a call to Object.assign(). But, no version of Internet Explorer supports that method, so it also means bringing in a polyfill for Object.assign(), which includes a for loop.

JavaScript code:
// original source
export const foo = {};
export const bar = { ...foo };
JavaScript code:
// transpiled to ES5
var __assign = (this && this.__assign) || function () {
    __assign = Object.assign || function(t) {
        for (var s, i = 1, n = arguments.length; i < n; i++) {
            s = arguments[i];
            for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
                t[p] = s[p];
        }
        return t;
    };
    return __assign.apply(this, arguments);
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.bar = exports.foo = void 0;
exports.foo = {};
exports.bar = __assign({}, exports.foo);

necrotic
Aug 2, 2005
I owe my brother big time for this!
Oh, yeah I didn’t consider extra features like that. Easy enough to avoid them if the class is (stupidly) strict on ES5 only.

Apex Rogers
Jun 12, 2006

disturbingly functional

I think you need to take a step back and work within the parameters provided to you. You won’t always have full control over your tech stack and I would guess that most workplaces will have some sort of limitations like this. Perhaps these are on the extreme end of things, but such is life.

The sooner you accept your reality and stop banging your head against it, the sooner you can complete your assignment, and probably with less headache at the end of the day.

Or just keep banging your head against the wall, you do you.

Apex Rogers fucked around with this message at 18:38 on Nov 18, 2023

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.
This is sounding like the most realistic intro dev course around. Possibly unintentionally.

Also flashing back to failing an assignment because I used java.util.Scanner when that was next week's assignment.

Ihmemies
Oct 6, 2012

I first completed the assignment by ripping out all 😓the advanced features. Next I spent 6 hours trying to figure workarounds, then two more complaining when none worked.

The course is done enough for me, I have enough points for grade 4 where 0 is fail and 5 is best.

In the full stack open course I linked earlier there doesn’t seem to be version restrictions. It uses Vite+react and does not have automatic testers, so I am going to use .tsx instead of .jsx because no one is stopping me!

I wish webdev went back to server side rendering. Server provides static HTML and CSS and that’s it.

necrotic
Aug 2, 2005
I owe my brother big time for this!

Ihmemies posted:


I wish webdev went back to server side rendering. Server provides static HTML and CSS and that’s it.

Careful what you wish for, friend.

Server Side rendering of React and the like is big now, but you still end up with a whole React front end after it all loads.

And so many use awful CSS in JS frameworks that do insane things like mutate a style sheet a thousand times on page load, each being a repaint.

Adbot
ADBOT LOVES YOU

Apex Rogers
Jun 12, 2006

disturbingly functional

pokeyman posted:

This is sounding like the most realistic intro dev course around. Possibly unintentionally.

Also flashing back to failing an assignment because I used java.util.Scanner when that was next week's assignment.

Yup. This reeks of junior dev coming in and trying to change the world on day 1, not realizing the restrictions that are in place, for good or bad.

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply