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
Paul MaudDib
May 3, 2006

TEAM NVIDIA:
FORUM POLICE

Volguus posted:

A bit late to the question, but servlets are not archaic at all. They are used today by ... everything really. Spring itself (or any other framework) still has a dispatcher servlet that listens to the request, looks at the parameters and headers and HTTP verb and then decides what class to call, what method with what params. JSPs themselves become servlets, then compiled into bytecode. While it is true that most developers nowadays do not write servlets anymore and do not have to deal with its awful "servletOutputStream.println" peppered everywhere (or templated, but same poo poo really), it is still extremely important for a developer to know what goes on underneath all that magic. Do your homework, learn how to write them and don't forget all of that when you move to greener pastures.

There are times (very rarely thankfully) when I need to accept an (Http)ServletRequest as a parameter to a method or write to an (Http)ServletResponse. They come from the servlet that called me which got them from the application server. I don't think they'll ever be completely gone, for as long as Java will stick around at least.

we're in agreement, I said that the web API (servlets/filters/etc) are some of the few parts of Java EE that remain directly relevant (vs most of the rest of EE where anyone who is not deep in the poop writing their own application server will never need to know), but that in most cases (barring things like file transfers/etc) you won't be touching them directly.

Paul MaudDib fucked around with this message at 00:18 on Jul 29, 2020

Adbot
ADBOT LOVES YOU

carry on then
Jul 10, 2010

by VideoGames

(and can't post for 10 years!)

Paul MaudDib posted:

deep in the poop writing their own application server


Yep
:confuoot:

uguu
Mar 9, 2014

If you follow the instructions in eclipse for creating a helloworld, you get
code:
Error occurred during initialization of boot layer
java.lang.module.FindException: Module helloWorld not found
That's not very encouraging.

carry on then
Jul 10, 2010

by VideoGames

(and can't post for 10 years!)

Man, that post made me realize that despite 6 years of professional Java experience I just have no idea how JPMS works.

Hekk
Oct 12, 2012

'smeper fi

uguu posted:

If you follow the instructions in eclipse for creating a helloworld, you get
code:
Error occurred during initialization of boot layer
java.lang.module.FindException: Module helloWorld not found
That's not very encouraging.

People have very strong feelings about IDEs. I am willing to work with most anything but Eclipse.

Paul MaudDib
May 3, 2006

TEAM NVIDIA:
FORUM POLICE

Hekk posted:

People have very strong feelings about IDEs. I am willing to work with most anything but Eclipse.

eclipse is my go-to example of why you don't let engineers design UIs.

I think it's widely agreed that intelliJ is the way to go, especially if you are eligible for a student license or are willing to work around the limitations on the "free" edition

uguu
Mar 9, 2014

carry on then posted:

Man, that post made me realize that despite 6 years of professional Java experience I just have no idea how JPMS works.

How do you avoid it then?
I just used an older version of the jre, but this was for a one off.

carry on then
Jul 10, 2010

by VideoGames

(and can't post for 10 years!)

uguu posted:

How do you avoid it then?
I just used an older version of the jre, but this was for a one off.

Everything we write has to be source and target compatible with 8 if not 6. So I guess we never put our code in JPMS modules. Plus the main products already used OSGi and have for years/decades.

Guildenstern Mother
Mar 31, 2010

Why walk when you can ride?
I can't for the life of me figure out how to fit this stupid question into a google search. So I want to have a button on each item on my page that will take you to a page with all the item details. (They're cars) I know I want to use the vin number as the unique id's, I just don't know how to even start writing the servlet.

edit: I know this is a fantastically stupid question but we kind of were just given a basic 1 day overview on servlets and cut loose on this.

Guildenstern Mother fucked around with this message at 17:38 on Aug 6, 2020

Janitor Prime
Jan 22, 2004

PC LOAD LETTER

What da fuck does that mean

Fun Shoe
Do you have the HTML structure for your page figured out? What are you using for your view (JSP, thymeleaf, are you writing out HTML in your servlet)? In any case what you want is a servlet that has a URL mapping like
pre:
/car/{VIN}
In the servlet code you'd get the VIN number from the URL and then do a lookup to get all the rest of the information. Once you have that info you send it to your view layer so that it renders the page with the new info. Not sure if that answers your question, but hopefully gets you going.

Volguus
Mar 3, 2009

Guildenstern Mother posted:

I can't for the life of me figure out how to fit this stupid question into a google search. So I want to have a button on each item on my page that will take you to a page with all the item details. (They're cars) I know I want to use the vin number as the unique id's, I just don't know how to even start writing the servlet.

edit: I know this is a fantastically stupid question but we kind of were just given a basic 1 day overview on servlets and cut loose on this.

What Janitor Prime recommended will work, but if I remember correctly (it's been 20 years since I last wrote plain servlets) it's a bit of a pain to have dynamic paths like that. With spring & co it's a trivial matter but not with plain servlets. The easiest way is to accept query parameters. So you have your CarDetailsServlet which is mapped to /car path and is called like this: /car?vin=ABCD

Then in it's doGet method, you simply call HttpServletRequest.getParameter("vin") and you get the VIN and you're off to the races.

Combat Pretzel
Jun 23, 2004

No, seriously... what kurds?!
Over on my new workplace I had first discussions about which way to go to overhaul and ditch a bunch of old-rear end Foxpro applications. The IT department is a Java/Eclipse shop, so I have been loosely looking at things recently. I'm not too excited about SWT so far. Are there any other more modern (looking/themable) UI toolkits that can be used in the Eclipse environment? (--edit: The applications will run on Windows.)

Personally, I'd rather be dealing with Electron (or something similar), but it's uncertain I can push this yet. More so, since they'd like to do REST APIs returning JSON (instead of crawling the DB400 with SQL queries), and considering the first two letters of the output format...

carry on then
Jul 10, 2010

by VideoGames

(and can't post for 10 years!)

Combat Pretzel posted:

Over on my new workplace I had first discussions about which way to go to overhaul and ditch a bunch of old-rear end Foxpro applications. The IT department is a Java/Eclipse shop, so I have been loosely looking at things recently. I'm not too excited about SWT so far. Are there any other more modern (looking/themable) UI toolkits that can be used in the Eclipse environment? (--edit: The applications will run on Windows.)

Personally, I'd rather be dealing with Electron (or something similar), but it's uncertain I can push this yet. More so, since they'd like to do REST APIs returning JSON (instead of crawling the DB400 with SQL queries), and considering the first two letters of the output format...

As far as UI toolkits, the most modern one I know of is JavaFX which should probably work in Eclipse-based apps but if you're writing an Eclipse plugin you're stuck. As far as handling JSON, just pull in a library like Jackson or Yasson and handle it that way. While I'm sure that you personally want to use JS, if the rest of the org has Java experience and existing Java code, there are a multitude of reasons to stick with Java.

Sagacity
May 2, 2003
Hopefully my epitaph will be funnier than my custom title.
Perhaps TornadoFX could be interesting as well?

Combat Pretzel
Jun 23, 2004

No, seriously... what kurds?!

carry on then posted:

While I'm sure that you personally want to use JS, if the rest of the org has Java experience and existing Java code, there are a multitude of reasons to stick with Java.
There's some weird disconnect in this plant. While this office is production planning, we're also doing a lot of statistics and analytics, and the tools are our own.

The Foxpro crap was introduced like 16 years ago, already late as it is in regards to technology of choice, and it was eventually dropped in the lap of a computer nerd in the office, that taught himself some basic programming and SQL to maintain them. Since Foxpro is obsolete as gently caress, it eventually needs replacement. More so with IT's plans of hiding database access behind REST APIs.

I'd rather not be cornered into a solution I'd not like. My own opinion is that if I need to write a bunch of applications that do a lot of wild visualizations (management likes pictures), I'd need a capable environment for this. At least on first glance, SWT doesn't really look the part, and generating a bunch of HTML and SVG inside Electron seems a better option than dealing with a two digit amount of third party components. Not to mention, if I'm writing an app, I'd like it to look like the decade it was conceived in. Their current stuff looks like it came from the nineties. However if push comes to shove, I'd like to know my options.

Also, my predecessor claims that the three Java programmers upstairs can't grasp Excel's VLOOKUP, which is pretty :psyduck: in itself, so I'd rather avoid associating with them to begin with by going my own way. Otherwise I'd have to do training sessions with them to get up to speed with their coding practises.

Sagacity posted:

Perhaps TornadoFX could be interesting as well?
Thanks, I'm gonna bookmark this and JavaFX.

Volguus
Mar 3, 2009
SWT can certainly do what you're asking. There is no reason not to. The only objection to SWT that one may have is how it looks and how easy/hard is it to apply a theme to it. Other than that, anything that you can do in Electron you can do in SWT, just with different technologies. But, if you're really set on HTML/JS, both SWT and JavaFX can display web pages, albeit not at the speed and capability of a full blown chromium browser, which is what Electron is. Building a full desktop HTML application in SWT or JavaFX would not be recommended.
JavaFX on the other hand (let's ignore Swing as it is quite old and not sure if even maintained anymore), can be made to look in any way you wish. Check out this page for some examples.


And yes, you can use JavaFX in any IDE you want, Eclipse included.

But, if you're set on web technologies, why not build a web application directly? In the browser. Why go with a desktop app?

lamentable dustman
Apr 13, 2007

🏆🏆🏆

Yea, if you are modernizing a bunch of internal apps I would suggest going with a web interface instead, if possible. You are going to be running a server to process everything into JSON already.

Otherwise use JavaFX

Combat Pretzel
Jun 23, 2004

No, seriously... what kurds?!

Volguus posted:

But, if you're set on web technologies, why not build a web application directly? In the browser. Why go with a desktop app?
I don't know. If it's enforced to go Java, the idea out of the window anyway. Otherwise, I suppose to have a stable environment for the app to run in, to avoid weird issues after browser updates. Plus I think it's easier to tie native code components into Electron? If that's gonna be necessary.

--edit:
Gonna take a while before actually starting anyway. I first have to go through tons of Foxpro code and document that bitch. Because there's none of that, either.

--edit:

Volguus posted:

JavaFX on the other hand (let's ignore Swing as it is quite old and not sure if even maintained anymore), can be made to look in any way you wish. Check out this page for some examples.
Those IAV Template Editor and MuseoID examples are the direction I want to go/get to. I'm gonna play around with Eclipse and JavaFX in my spare time at work.

Combat Pretzel fucked around with this message at 17:57 on Aug 15, 2020

Volguus
Mar 3, 2009

Combat Pretzel posted:

I don't know. If it's enforced to go Java, the idea out of the window anyway. Otherwise, I suppose to have a stable environment for the app to run in, to avoid weird issues after browser updates. Plus I think it's easier to tie native code components into Electron? If that's gonna be necessary.

Yeah, if you have to go Java and desktop is your only option, then Electron is out the window as well. Browsers lately have been quite stable and relatively standards conforming though. Nothing is perfect and there are every now and then weird bugs popping up, but you won't avoid that with Java either. While I do not have experience with Electron native (writing a c++ application that embedded the V8 JS engine doesn't count), Java native is not bad. But, if you need to go native too much, I'd reconsider the entire Java choice as well. Maybe a native desktop application would be more appropriate.

Soricidus
Oct 21, 2010
freedom-hating statist shill

Volguus posted:

(let's ignore Swing as it is quite old and not sure if even maintained anymore)

It is. All the jetbrains ides are pure swing and they look modern enough to my eye

carry on then
Jul 10, 2010

by VideoGames

(and can't post for 10 years!)

It's maintained, but I'd say that Swing requires a ton of effort to make it look and work as well as Jetbrains does.

Twerk from Home
Jan 17, 2009

This avatar brought to you by the 'save our dead gay forums' foundation.
Kotlin Spring question: If I've got an incredibly slow network call (6+ seconds) that can safely be cached for moderate periods of time (5 minutes), and using stale old cached values is acceptable, is there any clean way for me to get background threads to refresh the cache without any real requests paying that horrible penalty?

Basically, what I want is for this to schedule cache renewal, and somehow keep serving the old cached value while waiting for the new one to populate.

code:
@Scheduled(fixedRate = 300000)
fun evictTheSlowCallCache() {
	cacheManager.getCache("slowAssCall").clear()
	slowAssCall()
}

@Cacheable("slowAssCall")
fun slowAssCall(): ResponseType
That's clearly not what these annotations actually do together, as this would first evict the cache and then refill it, leaving all of the requests that come in before it's filled again to make the slow call themselves.

If I do sync="true" in @Cacheable, then they'll at least use the first response rather than waiting on their own, but will still not use the previously cached value and be stuck waiting. I don't see an easy way to do this other than stepping pretty far outside of easy Spring norms and manually managing a volatile property and managing the in-memory caching myself.

I guess what I would do there is have a @Scheduled method that makes the slow call, reads it into a new object, and then in a single atomic operation reassigns the volatile property on the class.

CPColin
Sep 9, 2003

Big ol' smile.
I'm honestly surprised Spring doesn't already have an obvious way to do that; it seems like a pretty standard policy for managing cached data.

Jabor
Jul 16, 2010

#1 Loser at SpaceChem
@CachePut seems like the obvious solution.

Twerk from Home
Jan 17, 2009

This avatar brought to you by the 'save our dead gay forums' foundation.

Jabor posted:

@CachePut seems like the obvious solution.

CachePut does exactly that and I have no idea how I had missed it, thank you!

dirby
Sep 21, 2004


Helping goons with math
I'm new to IntelliJ. Around 1:21 in
https://www.youtube.com/watch?v=hi85qx6006A&t=81s
It looks like they replace expressions like dirty > 30 with the variable isDirty that was defined to be that in a single keystroke. I assumed this would be somewhere in the refactoring menu, but I couldn't quickly find online or in IntelliJ what they might have done. Any idea what keyword I should be searching for? Are they just pasting something?

dirby fucked around with this message at 16:11 on Aug 24, 2020

carry on then
Jul 10, 2010

by VideoGames

(and can't post for 10 years!)

dirby posted:

I'm new to IntelliJ. Around 1:21 in
https://www.youtube.com/watch?v=hi85qx6006A&t=81s
It looks like they replace expressions like dirty > 30 with the variable isDirty that was defined to be that in a single keystroke. I assumed this would be somewhere in the refactoring menu, but I couldn't quickly find online or in IntelliJ what they might have done. Any idea what keyword I should be searching for? Are they just pasting something?

It looks like they are copying and pasting; the cursor goes off to the left and back every time they make a change.

baka kaba
Jul 19, 2003

PLEASE ASK ME, THE SELF-PROFESSED NO #1 PAUL CATTERMOLE FAN IN THE SOMETHING AWFUL S-CLUB 7 MEGATHREAD, TO NAME A SINGLE SONG BY HIS EXCELLENT NU-METAL SIDE PROJECT, SKUA, AND IF I CAN'T PLEASE TELL ME TO
EAT SHIT

Yeah they're just demonstrating a different way of writing the code to make the when block more readable

It's not 1 keypress but if you have cursor over the expression you can do Extract Variable (ctrl+alt+V) it'll pull it out to whichever scope you want and let you rename it, sometimes it even guesses a good name!

Having the cursor over > instead of dirty will usually give you a more relevant first suggestion so you can just hit enter

smackfu
Jun 7, 2004

Its nice and sane, all the refactoring shortcuts follow the same pattern. V for variable, m for method, p for parameter, c for constant, probably some more I dont use often enough to remember.

nakieon
Aug 28, 2020

Does anyone else here really hate conditionals and try to work around them? I feel they are unclean code, but I end up always having to have a conditional somewhere which leads to an inevitable if-else block or ternary operator. I probably abuse ternary operators way too much since I feel it's more concise.

For example, if I have a method that takes a bunch of arguments and every single thing in the method is the same except for an outgoing call that returns a specific object that needs to be used for the rest of the method, I'll slap a ternary operator and do something like this:

// assuming there is an argument flag that indicates the desire for a Foo or a Bar, and this flag would be: boolean foo

FooBar fb = foo ? Utils.getMeFoo() : Utils.getMeBar();



Possible alternatives is to just make some Utils.getMeFooOrBar but then I still push the conditional down the chain, by doing Utils.getMeFooOrBar(foo); and it'd still have the ternary in there. I hate it. I hate it so much and I don't know why.

Ola
Jul 19, 2004

You can do pseudo pattern matching by passing types around and using instanceof, or you can possibly hand wave it away with some other structures, but it is as you say just pushing it down the chain. It calls for a boolean because you are in a boolean situation. Embrace it. I don't like it when it starts nesting multiple levels and with different booleans in each one, that's where functional programming's pattern matching starts paying off as it looks much tidier and can guarantee that you've covered all cases.

ChickenWing
Jul 22, 2010

:v:

I mean, I don't think you can reasonably be a programmer, hate conditionals, and expect to maintain your sanity. It's literally a fundamental instrument of programming - languages are basically just choices and arithmetic, and everything else is sugar.

Conditionals can definitely be a huge source of unclean code, though - cognitive complexity is an important consideration, and every time you add a branch to your code you increase it.

Given that you use ternary operators a lot, it sounds to me like you just don't like nested blocks, which is fair - over-nesting can lead to some gross, hard-to-maintain code. Ternary operators are great, when used responsibly. Your use case there is fine IMO (unless you're specifically making a FooBar object to hold a Foo or a Bar, neither of which have anything to do with each other, but that's a violation of SRP rather than an issue with ternaries), it's when you get into

code:
Thingy = foo ? Utils.getThing1() :
               bar ? Utils.getThing2()  :
                     ConditionObject.isThisTheRightCondition()
                     && SomeOtherObject.thatsRightAnotherBooleanMethod() ? Utils.getThing3() :
                                                                           Utils.getThing4()
that they become an issue (actually they're possibly an issue once you hit the first nested ternary but I'm being ridiculous for example's sake).


At the end of the day, you have to remember that a primary purpose of your code is for communication with your team members, viz. What The gently caress This Bit Of Code Is Doing. Choose your conditional structures based on what other people will be able to understand, rather than trying to win code golf or pursuing code aesthetic purity

nakieon
Aug 28, 2020

ChickenWing posted:

I mean, I don't think you can reasonably be a programmer, hate conditionals, and expect to maintain your sanity. It's literally a fundamental instrument of programming - languages are basically just choices and arithmetic, and everything else is sugar.

Conditionals can definitely be a huge source of unclean code, though - cognitive complexity is an important consideration, and every time you add a branch to your code you increase it.

Given that you use ternary operators a lot, it sounds to me like you just don't like nested blocks, which is fair - over-nesting can lead to some gross, hard-to-maintain code. Ternary operators are great, when used responsibly. Your use case there is fine IMO (unless you're specifically making a FooBar object to hold a Foo or a Bar, neither of which have anything to do with each other, but that's a violation of SRP rather than an issue with ternaries), it's when you get into

code:
Thingy = foo ? Utils.getThing1() :
               bar ? Utils.getThing2()  :
                     ConditionObject.isThisTheRightCondition()
                     && SomeOtherObject.thatsRightAnotherBooleanMethod() ? Utils.getThing3() :
                                                                           Utils.getThing4()
that they become an issue (actually they're possibly an issue once you hit the first nested ternary but I'm being ridiculous for example's sake).


At the end of the day, you have to remember that a primary purpose of your code is for communication with your team members, viz. What The gently caress This Bit Of Code Is Doing. Choose your conditional structures based on what other people will be able to understand, rather than trying to win code golf or pursuing code aesthetic purity

Aye, I agree wholeheartedly, I feel there's a better way but I can't quite grasp it. Some sort of mediator impl or something... but honestly, who wants to put all that up when you can just do if-else instead?

That ternary nesting is absolutely nasty though. I only use ternary operators when...

1) I need to assign a value to a object but I have to branch, and it's supremely annoying to repeatedly type:

code:
String s;
if (foo) s = "foo";
else s = "bar";
Then the compiler will throw up some warning or error that s might be uninitialized at runtime so okay, String s = null or "" then, which I feel is just a bit unclean just to satisfy the compiler.

2) I am making a method call but there's a quick value switch to null (but the original value is still used elsewhere in this hypothetical, otherwise fooObject could just be set to null beforehand) based on a flag and I didn't want to make a conditional just to call the same method two times but with slightly different code:

code:
someMethodCallThatAcceptsFooOrNull(foo ? fooObject : null);
Instead of doing:
code:
if (foo) someMethodCallThatAcceptsFooOrNull(fooObject);
else someMethodCallThatAcceptsFooOrNull(null);
I do think my case in #2 probably violates some SRP, but it looks good to me and I try to not do it more than once in a method call. If I do, I need to clean up my code better.

Ither
Jan 30, 2010

nakieon posted:

Does anyone else here really hate conditionals and try to work around them? I feel they are unclean code, but I end up always having to have a conditional somewhere which leads to an inevitable if-else block or ternary operator. I probably abuse ternary operators way too much since I feel it's more concise.

For example, if I have a method that takes a bunch of arguments and every single thing in the method is the same except for an outgoing call that returns a specific object that needs to be used for the rest of the method, I'll slap a ternary operator and do something like this:

// assuming there is an argument flag that indicates the desire for a Foo or a Bar, and this flag would be: boolean foo

FooBar fb = foo ? Utils.getMeFoo() : Utils.getMeBar();



Possible alternatives is to just make some Utils.getMeFooOrBar but then I still push the conditional down the chain, by doing Utils.getMeFooOrBar(foo); and it'd still have the ternary in there. I hate it. I hate it so much and I don't know why.

If a conditional gets too big or complex, I try to replace it with a lookup table. In the average case, lookup tables are faster and, to my eyes, cleaner.

Personally, I hate the ternary operator. For whatever reason, it takes my brain longer to grok an assignment that utilizes it.

chippy
Aug 16, 2006

OK I DON'T GET IT

nakieon posted:

Does anyone else here really hate conditionals and try to work around them? I feel they are unclean code, but I end up always having to have a conditional somewhere which leads to an inevitable if-else block or ternary operator. I probably abuse ternary operators way too much since I feel it's more concise.

For example, if I have a method that takes a bunch of arguments and every single thing in the method is the same except for an outgoing call that returns a specific object that needs to be used for the rest of the method, I'll slap a ternary operator and do something like this:

// assuming there is an argument flag that indicates the desire for a Foo or a Bar, and this flag would be: boolean foo

FooBar fb = foo ? Utils.getMeFoo() : Utils.getMeBar();



Possible alternatives is to just make some Utils.getMeFooOrBar but then I still push the conditional down the chain, by doing Utils.getMeFooOrBar(foo); and it'd still have the ternary in there. I hate it. I hate it so much and I don't know why.

You might find these interesting:

https://medium.com/edge-coders/coding-tip-try-to-code-without-if-statements-d06799eed231
https://alisnic.github.io/posts/ifless/

There are some interesting ideas but I think pursuing this to extreme levels is a bit silly. Your code is there to clearly express your intentions to other programmers primarily. A ternary operator and an if statement end up as the same bytecode, as far as I know. It's just syntactic sugar for an if-else statement so you could argue that it's no cleaner.

chippy fucked around with this message at 14:23 on Sep 1, 2020

Che Delilas
Nov 23, 2009
FREE TIBET WEED

Ither posted:

If a conditional gets too big or complex, I try to replace it with a lookup table. In the average case, lookup tables are faster and, to my eyes, cleaner.

Personally, I hate the ternary operator. For whatever reason, it takes my brain longer to grok an assignment that utilizes it.

I generally go through the following thought process

Is my conditional logic simple ? Use ternary operators : otherwise use if statements.

ChickenWing
Jul 22, 2010

:v:

Che Delilas posted:

: otherwise

:mad:

Twerk from Home
Jan 17, 2009

This avatar brought to you by the 'save our dead gay forums' foundation.
I prefer how Kotlin and Scala just use if as the ternary.

https://kotlinlang.org/docs/reference/control-flow.html
https://alvinalexander.com/scala/scala-ternary-operator-syntax/

nakieon
Aug 28, 2020

Che Delilas posted:

I generally go through the following thought process

Is my conditional logic simple ? Use ternary operators : otherwise use if statements.



I... wow. That is a great post. I read this 3 days ago and something just felt off about it.

Less than a minute ago I just realized you structured your last sentence in the ternary operator pattern: boolean ? expression1 : expression2

Amazing.

Adbot
ADBOT LOVES YOU

RandomBlue
Dec 30, 2012

hay guys!


Biscuit Hider

nakieon posted:

I... wow. That is a great post. I read this 3 days ago and something just felt off about it.

Less than a minute ago I just realized you structured your last sentence in the ternary operator pattern: boolean ? expression1 : expression2

Amazing.

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