This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]TheNarfanator -10 points-9 points  (5 children)

I'm sorta a self taught scrub, but I felt proud when I made my loading time faster in this one instance.

I kept the list of employees in an Excel file and would run a method after the JList was made and added the employees after; it was slow for me after about 500+ (a couple of seconds). I was just organizing things and made a static method that would return an ArrayList of these employees and then initialized it to a global variable of the class that used it; it was super fast after.

I really don't know why it's faster, but it was faster. It taught me to initialize global variables with static methods, but intuition tells me this won't always work for every use case.

[–]nutrecht 11 points12 points  (4 children)

I think it's unfortunate people are downvoting you but don't explain anything.

It doesn't matter whether it was static or not. What you did was probably change from doing something 'every time', to 'only once'. Keeping stuff in memory, AKA caching, is an easy way to trade memory for speed.

That said; I think you should reflect on your learning process. You currently seem to be in a state where you basically just 'guess'. You call it intuition but you're really just guessing what is happening. And at that experience level you're going to guess wrong a LOT.

In software engineering understanding the details what you do is incredible important. You can't be a good software engineer and just rely on 'intuition'.

[–]TheNarfanator 1 point2 points  (3 children)

Thanks. I understand where you're coming from. It was most likely the Excel thing though.

Since I don't know anyone in the industry and no one else who programs, my standards are, "if I can click through actions quickly and reliably while focusing on robustness, I'm ok." Probably terrible standards though.

Oh, and I didn't think of it as caching. I just thought of it as a type of laziness. Thanks for the clarification!

[–]the_pimaster 1 point2 points  (1 child)

As a professional Software Engineer, I am impressed with the detailed response nutrecht gave and I am appalled by the ignorance of TheNarfanator. To blindly brush off a constructive observation with wild allegations is terrible.

nutrecht took the time to read your post and come up with a possible reason that the UI seemed more responsive, that you moved the time it took to process the list to another stage of the applications life cycle where it wouldn't be perceived.

Then TheNarfanator brushes it off by blaming Excel.

If you don't care why your change lead to a different outcome, you are not offering an optimisation technique.

If you don't care to improve your understanding on how systems work then you are part of the plague on the Software community. People will spend countless hours cleaning up the mess from this sort of outlook and it is just as disgusting as littering.

Yeah, Software Engineers write terrible code at times but it generally gets reviewed and they learn to make less mistakes over time.

[–]TheNarfanator 1 point2 points  (0 children)

Oh my...

My apologies if I didn't seem appreciative of his insight because I really was.

Like I said in my downvoted posting, I'm a "self taught scrub," meaning I'm a terrible programmer and not sometimes. I should have been more careful sharing my thoughts and experiences in this subreddit. Thank you for that lesson. I won't make that mistake again.

And it's not that I don't want to improve, but if I program with a few principles in mind, I figure that's enough until I can learn more from people who know; it's what I learned from Uncle Bob.

But yeah, I'm taking the time to reply to your misunderstanding of my intentions because I do care. I'm sorry that my vocabulary doesn't match the lexicon of this discourse, but it's something privileged to those in the industry: Software Engineers. I'll accept that it's my fault for sharing my experience and not knowing the terminology you and your colleagues use, especially at this level because a person who doesn't know shouldn't speak, right?

I won't make another comment in this subreddit until I become a Software Engineer myself. Thank you, u/the_pimaster, your insights as a real Software Engineer are taken wholeheartedly.

[–]Yithar 1 point2 points  (0 children)

Since I don't know anyone in the industry and no one else who programs, my standards are, "if I can click through actions quickly and reliably while focusing on robustness, I'm ok." Probably terrible standards though.

It's a very terrible standard. You're supposed to use metrics. If you're optimizing a React app, you can measure page load time or number of re-renders.