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
Doom Mathematic
Sep 2, 2008
JavaScript is fine.

Adbot
ADBOT LOVES YOU

Doom Mathematic
Sep 2, 2008
A good programmer is a child who is learning to make silly games and having a blast.

Doom Mathematic
Sep 2, 2008

MALE SHOEGAZE posted:

also you’re not ignorant it’s yospos slang

It is? I thought it was like a mildly well-known industry term. That's how I use it at work anyway.

Doom Mathematic
Sep 2, 2008

ThePeavstenator posted:

Every single one of our automated UI tests are now failing because they can't create test accounts and users. Turns out the tests are somehow coupled to the implementation details of our Users API and broke when a change was made to it :suicide:

Sounds to me like the tests are working correctly? You almost shipped a breaking API change, well caught.

Doom Mathematic
Sep 2, 2008
Is there seriously not an automated tool which can fix PEP8 warnings?

Doom Mathematic
Sep 2, 2008

gonadic io posted:

i hope my "like a distributed database but worse in every way and also you have no control over it by design" comments sunk in, we'll see!

James Mickens did a good little talk about blockchain recently, it's quite funny but I found it to also be legit informative about what blockchains do and why it's not really very useful for them to do that.

https://www.youtube.com/watch?v=15RTC22Z2xI

Doom Mathematic
Sep 2, 2008

Schadenboner posted:

How can I get myself to a place where any of what you guys are talking about makes any sense?

:(

Honestly, (1) program in more different languages, (2) compare and contrast the differences in how programming works in those languages and then (3) look up the proper technical terms for those differences.

Doom Mathematic
Sep 2, 2008
I'm more interested in how this person was allowed to work for two or three straight weeks in a row, by himself, with nothing to show for it. Every morning, "Nope, still haven't done any work"?

Doom Mathematic
Sep 2, 2008

ulmont posted:

ls [-AabCcdFfghikLlmnopqRrstux1] [-timeout seconds] [-X attr] [pathname...]

It's the most remarkable word I've ever seen!

Doom Mathematic
Sep 2, 2008

jit bull transpile posted:

time is probably the most difficult thing there is to represent computationally

...Says the person with a human name.

I mean, I assume.

Doom Mathematic
Sep 2, 2008

jit bull transpile posted:

names are easy: "do not, in any circumstance, attempt to normalize, tokenize, sort, or otherwise manipulate names"

names should be a natural key for a record related to a human that is mutable only by the human themselves.

What about people with multiple different names?

Doom Mathematic
Sep 2, 2008
It's not about free choice, it's about sharing/understanding their users' pain points.

Doom Mathematic
Sep 2, 2008

Finster Dexter posted:

Let's pour one out for webdev of old... here's to you, cgi-bin

They call it "AWS Lambda" now.

Doom Mathematic
Sep 2, 2008
You're in luck! Parsing C++ source code is famously straightforward.

Doom Mathematic
Sep 2, 2008

cinci zoo sniper posted:

heh

we have in prod a solution that works as follows:

1) microservice queries sql db DB1 and some other poo poo to gather a document A, form it as xml following schema S.1A, and write to DB1
2) another service takes this document A and sends it to external service E
3) service E generates an xml response B following schema S.0, that contains:
3.1) response header containing technical particulars
3.2) xml document (following its own, unique schema) inside said header with general information corresponding to contents of A
3.3) a <Field "A"> element inside (3.2) containing an xml document with full contents of A, only with values formatted (think grammar, capitalised etc) formatted properly and the document itself restructured to follow schema S.1B
3.4) half a dozen <Field "Thing"> elements inside (3.2), each an xml document with a unique schema, containing separate parts of response to the inbound query in great detail
3.5) HTML version of (3.2) (excl. 3.5 obv) inside 3.2, so you can look at it nice and shiny in browser :)

trick is, at this point you may be asking "but wait, how do they insert xml document into xml document?". well, it's simple really -

"The Aristocrats!"

Doom Mathematic
Sep 2, 2008

H2Eau posted:

how the gently caress did they manage that

Probably counting npm install as part of the "compilation"?

Doom Mathematic
Sep 2, 2008

Jabor posted:

30 seconds is too long imo, our incremental builds take about that long and it's long enough to break your flow.

ideally you'd be down in the single digits.

A webpack-dev-server-based incremental build will give you that. You hit save and the page immediately refreshes with the changes. I agree that 30 seconds is far too long to maintain workflow. When folks were throwing around figures of fifteen minutes I assumed we were talking about full-scale CI builds or something.

Doom Mathematic
Sep 2, 2008

NihilCredo posted:

case 2 means being able to say 'hey, we have objective evidence that the problem isn't on our side and it wasn't a case of miscommunication, it's *your* software that is not respecting the specs' which saves a crazy amount of time and therefore money

The problem is that just because a problem is objectively caused by someone else, doesn't mean that you're not the one who has to "fix" it.

Doom Mathematic
Sep 2, 2008
Perl probably just has an implementation of some other programming language which has an implementation of protobufs.

Doom Mathematic
Sep 2, 2008

karms posted:

a pull request of mine got denied because it wasnt necessary. it was to change all misspelled bandwith methods to bandwidth

literally search and replace

of new code that will be around for a very long time

gently caress me

Wait until you start finding variables named bandwidth in the same scope, doing subtly different things.

Doom Mathematic
Sep 2, 2008
Yes, JSON.stringify(null) is indeed the JSON string "null", and JSON.parse("null") is indeed the value null.

I'd be more worried that, for example, JSON.stringify(undefined) is undefined, which is not a string, and JSON.stringify([undefined]) is "[null]"??

Doom Mathematic
Sep 2, 2008

Main Paineframe posted:

just learned about functional css/atomic css

holy poo poo, it is absolutely the worst css-related idea I've ever heard

though now that I think about it, I can't think of any good css-related ideas

The best CSS-related idea I've ever heard is BEM, whose core concept is "avoid, at all costs, the cascade".

Doom Mathematic
Sep 2, 2008

Finster Dexter posted:

Honestly, this probably accounts for a lot of its popularity.

It boggles my mind how people continue to underestimate the critical importance of documentation, examples and good error messages. Especially for early adoption.

Doom Mathematic
Sep 2, 2008

Ciaphas posted:

i'll goog around of course, but while i'm at it, would anyone like to explain "microservices" to someone who's effective been out of the loop for ten years?

like, where's the micro-, what's the line, what does a single microservice, er, serve, what's so special about em?

I believe canonical source on that whole thing is Martin Fowler.

Doom Mathematic
Sep 2, 2008

uncurable mlady posted:

I thought react had a state container like redux now?

As I understand it, React essentially is a state container of this kind. A React component has a state property which is only ever modified using discrete setState calls. This strikes me as very similar to the way Redux is intended to work, clearly separating state (which you're not supposed to modify directly) from actions which cause modifications that state. They're very similar beasts, which is why I've found it a little frustrating to get them to cooperate with one another. It could be you're talking about something else though.

Doom Mathematic
Sep 2, 2008

DONT THREAD ON ME posted:

Yeah my impression of modules based on reading hype online was that they'd allow you to make dependencies private, so that two different modules can require two different versions of the same dependency without a conflict (which is one of the biggest problems I've had dealing with java).

Hold up. Java can't do this?

Doom Mathematic
Sep 2, 2008

DELETE CASCADE posted:

inheritance is not the problem, implied subtyping due to inheritance is the problem

OK, perhaps I'm a fool, but this a safe space so would you mind explaining the distinction between inheritance and subtyping? I thought they were the same thing.

Doom Mathematic
Sep 2, 2008
Just comment out the code a second time.

code:
// Don't change the code below to this:
// // <bad code>
// because it will not work
<actual code>

Doom Mathematic
Sep 2, 2008

ratbert90 posted:

I made a bit less than $350,000

Ah, the coveted six and a half figgies?

Doom Mathematic
Sep 2, 2008

Sapozhnik posted:

I extensively document a piece of code one week before it gets deleted. Every time.

Hmm. That's a net gain. Maybe you should document more code.

Doom Mathematic
Sep 2, 2008
Set up a pre-commit hook which automatically formats everybody's code consistently and have done with it?

Doom Mathematic
Sep 2, 2008

NihilCredo posted:

Can you expand? I've never done more than dabbling with JVM langs. Are you supposed to write manual serialization / deserialization functions as a matter of best practice?

There are also vulnerabilities associated with this kind of thing, I think, because the Java serialization format tells the deserializer what class it represents an instance of, rather than you, the programmer, specifying this. So the deserializer just runs away and constructs an instance of whatever class it was told to construct. That can be any constructor of any class your JVM has available. That constructor can have any conceivable side-effect.

Doom Mathematic
Sep 2, 2008

Feisty-Cadaver posted:

the built in serialization is also being straight up removed in a future jdk iirc

Good to know!

Doom Mathematic
Sep 2, 2008
Thirding or fourthing completely not caring about individual git commits, squashing them all together in the eventual pull request, but paying real attention to the title and wording of the PR.

Doom Mathematic
Sep 2, 2008

Gazpacho posted:

Holy cow I sure do like programming with strings. Whose dumb idea was it to invent other types?

This is called "stringly typed" programming.

Doom Mathematic
Sep 2, 2008

Soricidus posted:

ctps:
code:
    private static class ShutUpLeaveMeAloneYoureNotMyRealDad extends PrintStream
    {
        ShutUpLeaveMeAloneYoureNotMyRealDad(PrintStream out)
        {
            super(out);
        }

        @Override
        public void println(String x)
        {
            switch (x) {
            case "REMEMBER: The numbers below are just data. To gain reusable insights, you need to follow up on":
            case "why the numbers are the way they are. Use profilers (see -prof, -lprof), design factorial":
            case "experiments, perform baseline and negative tests that provide experimental control, make sure":
            case "the benchmarking environment is safe on JVM/OS/HW level, ask for reviews from the domain experts.":
            case "Do not assume the numbers tell you what you want them to tell.":
                break;
            default:
                super.println(x);
            }
        }
    }


Dijkstracula posted:

who says inheritance is a bad idea

One time we were writing Python to interact with a HTTP API which, contrary to the spec, treated HTTP request header names case-sensitively. Something like, "USER_KEY: blah" would work, but "user_key: blah" would not. Unfortunately, Python's HTTP library helpfully flattens the case of headers before sending, so we would do something like set_header("USER_KEY", "blah") and it would get sent as "user_key: blah", so it was essentially impossible to get the API to work from Python. (Or to get the fools in charge of the API to fix it.)

In the end what we ended up doing was subclassing Python's string class and overriding the .lowercase() method so it didn't do anything, it just returned the unmodified string. set_header(CustomStringClass("USER_KEY"), "blah") worked.

Doom Mathematic
Sep 2, 2008
I agree with your implicit point that's always wise to assume good faith. People do the best work they can and are often dealing with other requirements which you can't see.

But, no, they were just hopelessly bad at their jobs and I don't think they could have fixed their own code if they tried. Another part of this same API had an issue where every now and then requests would stop returning content. Still 200 OK and the right XML wrapper, just the requested resource which was supposed to be inside that XML was missing. After we brought this up with them, they told us that, yes, this starts happening from time to time, and if it happens, we should contact them so they can restart the server.

Doom Mathematic
Sep 2, 2008

Sapozhnik posted:

Angular 1, 2, or 4?

Angular 1 is a real piece of work. It boggles my mind that anybody voluntarily used it, or achieved anything with it, prior to the 1.5 release. After that it was possible to retain a bit of sanity by exclusively using components and one-way bindings but it still has a hopelessly overengineered architecture and the absolute worst documentation. Every page in the AngularJS docs makes perfect sense if and only if you already understand everything about AngularJS. Every example is so convoluted that it's impossible to grasp what they're actually trying to demonstrate. To this day I have still not been able to find the page in the docs where they explain the full list of possible binding sigils and what they all do. And I love how the module system is perfectly designed to flummox any bundling system more complicated than "manually concatenate all the source files in the right order".

E: Angular 2+ might be great, I don't know, we've moved to React.

Doom Mathematic fucked around with this message at 20:59 on Apr 3, 2019

Doom Mathematic
Sep 2, 2008
I have not yet come to a solid conclusion about whether Redux is a good or bad thing overall. I think I haven't used it properly yet.

It's good because it means in theory nearly all the state for your entire application can be kept in a single data structure operated on by a strictly defined collection of possible actions. This is amazingly easy to unit test. Meanwhile, because they have no internal state, your components become incredibly simple (in a lot of cases, functional) which likewise is insanely easy to test. This feels like an improvement over the state of the application being distributed across every component instance in the application, and it means that if a thing happening in one component needs to affect something in another component, it's very easy to make that happen.

It's bad because the connector component which links the React component to Redux is relatively complex and annoying to test. The song-and-dance around defining all of your actions up front and then carefully instantiating and dispatching them feels very boilerplatey and, as mentioned, increases the codebase size. It also makes it harder to produce a reusable component which can be consumed by third parties - do they have to rig up an identical state object in order to use it? Or do they have to reproduce the whole interface between the component and the state store themselves? There might be workarounds for these. There might be other bad things I haven't run into yet or which I'm forgetting.

Adbot
ADBOT LOVES YOU

Doom Mathematic
Sep 2, 2008

NihilCredo posted:

there are only two kinds of languages: the ones people complain about, the ones nobody uses, and sql

:newlol:

E: it is a ternary logic joke

Doom Mathematic fucked around with this message at 16:21 on Aug 18, 2019

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