Details
Joined devRant on 4/26/2018
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API

From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
-
Weird error message from webpage: "Hello, my name is Inigo Montoya. You killed my webpage. Prepare to die".
It's a Princess Bride parody...
Developers get creative (or bored) these days with error messages.. Yes, one of those again.1 -
Reaction to average session of difficult-to-grasp, unintuitive programming concept: uAaaaUuuuUuuuuUUUUuuuuUuuuuUUHHHHRGHHHHHHHHHhhh!
:headache:2 -
Hhhh... it is tough staying upbeat and enthusiastic when you go through interview after interview, 100 of them. They expect you to be that, though...16
-
JavaScript keeps surprising me, or I'm just rushing. lol
class Group {
#group;
constructor(){
this.group = [];
return this.group;
}
add(item) {
// only if it isn't already a member
// value can be part of set only once
if(!this.has(item)) {
group.push(item);
}
}
has(item){
// return boolean: item member of group
for(let i=0; i<group.length; i++) {
if(group[i] === item) {
return true;
}
}
return false;
}
let group = new Group();
group.add(1);
console.log(group);
Error: group.add() is not a function
Why is group.add() not a function?
A.I. analysis:
1. Private field vs public field:
A private field #group can only be accessed as this.#group. But in the constructor, I wrote:
this.group = [];
This creates a new public field, unrelated to #group.
2. Returning from constructor:
return this.group;
In JavaScript, a constructor automatically returns this, which is the instance of the class. Returning this.group replaces the instance with the array. That’s why after new Group(), your variable group is just an array, not an instance of Group. Arrays don’t have the add method — hence the error.
3. Referencing group inside methods:
group.push(item);
Here group is not defined. You probably meant this.group (or this.#group if using the private field).
Note to self: in the magic of computer science, you must be precise. If I loosely define the black box, the result will have a chance of producing anomalies.. kind of like reality. lol8 -
I'm sitting here realizing that Software Development and Computer Science in general, heck, STEM, is the most difficult skillset to endure because of the stress we go through as well when dealing with the workplace, especially the workplace.
I looked up how hard Computer Science is versus Advanced Physics and it is rated 40 vs. 80, the latter being doubly difficult. Now I got to thinking: Could it be us as developers are experiencing near-80 difficulty because of the stress we are put through to rush through deliveries at work? Maybe it's a 50. Hm, hm.
What a delight it must be (no sarcasm) to be able to research and perfect something for 20 years without people breathing down your neck about deadlines.. aaaahhh... lol.1 -
Story:
Useful lesson I learned in a JavaScript book:
"Classes are abstract data types in the sense that they are a layer around the complexity (encapsulation). Their singular nature allows them to be reused without being rewritten everywhere.
A good analogy is thinking of classes as appliances; the complex circuitry and components that an appliance comprises of are made by different people than the abstract shell around these components, of which (another) team only needs to know which buttons to access which parts.
A class abstracts away the internal complexity (components) and only exposes a public interface (the buttons) that the user (yet another group, comparable to the consumer of the class) is going to use."
It reminds me of how Google uses the Facade pattern to only expose the search box and the button as its public interface and all the complex architecture is hidden away.
This helped clarify classes better for me.5 -
!dev This video made my day:
https://youtube.com/shorts/...
Rofl. Viral potato recipe. Wait a minute, that sounds like coding!
P.S.: When I hear 'devRant' I hear a bull bellow for some reason. devRHUUUUUUUUUUUAAAAAAANT. lol1 -
!rant Lovely quote:
“There are two ways of constructing a software design: One
way is to make it so simple that there are obviously no
deficiencies, and the other way is to make it so complicated
that there are no obvious deficiencies.”
—C.A.R. Hoare, 1980 ACM Turing Award Lecture2 -
!dev Isn't it hilarious how some companies 'try' to look professional by dumping a bunch of stock images to present their brand? For example, a guy touching a holoscreen, or a bunch of overly stock happy corporate drones smiling and 'working' together in a 'meeting'.
I mean, it's sad. lol8 -
"Block scope in console REPL:
Each line you type in the console is evaluated in a separate, temporary scope. This sometimes makes let and const behave differently than if you wrote the same code in a <script>."
Interesting... I didn't know that. lol -
https://stackoverflow.com/questions...
JavaScript sure is a pain in the butt when it also throws errors depending if you are in a REPL or not.
Hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh.3 -
DevRant is slow today.
I came in like a laaaaaaaaaaaaaaaaagging baaaaaaaaaaall, I never hit so haaaaaard in loooooooooove
lmao.3 -
I found a simple code example in a book teaching programming concepts:
let result = 1;
let counter = 0;
while (counter < 10) {
result = result * 2;
counter = counter + 1;
}
console.log(result);
// 1024
...I can't believe I didn't get it right the first time. Yes, the result is 1024 and not 20. For it to result in 20, the statement would have to be:
result = result * counter.
Upon reflection I concluded: An exponent is a multiplication by a multiplication, so... it exponentially grows.
So I ask: how do you develop a second nature for these kind of problems? You studied it? You studied and practiced it? You're awesome at mathematics? It annoys me that my intuition often wrongs me when it comes to mathematics.23 -
Like many of us, tired of hearing the expressions: "infused with A.I.", "powered by A.I.", "augmented with A.I.", "A.I.-first", etc.6
-
Good dev: test suites, documentation, tracking
results: decent coverage, more predictable, more maintainable, saves time and money, accountable to stakeholders, happier team thanks to transparency
environment: matured middle-sized to bigger company who takes things seriously (because they usually have to if they work in a heavily regulated sector)
Bad dev: idgaf attitude, let's just run with it and see what happens flow, go for bare minimum happy path
results: a new bug at every possible situation, mystery bugs, an endlessly-growing backlog where people in the team are so depressed no one cares what ticket to take on, morale goes down crapshoot and so does code
environment: start-ups who want quick wins and make money-based decisions only and whose budget is being guarded by the higher-ups
I've worked with a bad dev before and also with a good dev and I appreciate the difference. lol. Nightmare.16 -
Job-hunting feels like playing Age of Empires; the cities are guarded by the recruiters.
Rogan? Wololoo.6 -
Do you use an iPod?
<3<3<3
'cause like, I think modern smartphones (unless you're listening to mp3 or midi) will run out of battery comparatively faster than an iPod. Y'knowwww.16 -
There are still websites that miss the simple, modern UX feature of saving form state. No, it's not 'push a button to apply the filter' anymore, it should be 'tick the box, slide the slider' and the state gets persisted immediately.
Or something else: perform a search, apply filters, and the original search is lost. Tf, man? lol.
This just shows that some places aren't investing.3 -
How do you compete and distinguish yourself as a freelancer from the other super-experienced freelancers? To me it seems almost impossible to get a foot in unless you're a niche expert, and even then.
Say you have 4 years dev experience. How the heck can you match up against someone with 15 years experience or someone with 5 years + several successful client projects? Or someone who's flawless at Full-Stack and you're just a mere beginner?
It seems to me you have to be super strong at selling yourself.6 -
GRAARGHHHHHHHHHHHHH POOHHHHHHHHHHHHH!!!
That's just my frustration with SourceTree.
This is a story all about how my SourceTree got twisted upside down, and I'd like to take a minute to just sit right there and tell you how I pushed my code to my repository on GitHub:
Iiiiiin my SourceTree, born and raised, I checked out my branch, tried to push but SourceTree said: "See ya later!" (denied/authentication failed). Sssoooo I told myself I was not going to use ChatGPT to solve this problem. I was going to use my Medior skillzzzz1!1!1!Oen and so I did solve it, but what a fucking hassle!
First I tried to remove all credentials from SourceTree and from my system, then I tried to add a fine-grained PAT, and finally... someone mentioned on StackOverflow that it was the git version that was oudated. So, SourceTree has an outdated embedded git, even on the latest version. Wtf?! Anyway, so I let it choose system git (which uses the latest git version).
And now it works!
Haaaaaaaaaaaaaaaaaaaaaa.14 -
You are considered a junior developer when you need 'a lot of hand-holding'. Now, I can figure out most things on my own, but how do you distinguish between 'needs too much hand-holding and therefore is a junior' and 'does ok and therefore is a medior'?
For example, I can do well on basic things and getting projects set up, but then I might need more help if errors truly become too cryptic or difficult to solve and I haven't found solutions. A few examples here:
- having messed up the git branches and releases so much that you need someone with a deep knowledge and troubleshooting of git to set the situation straight
- spending a week on trying to figure out why Azure doesn't want to successfully build your super custom build and it takes ages to figure it out because it requires in-depth Docker, linux knowledge and stellar, MIT-level troubleshooting and analytical skills
And so, someone who needs help with these is considered a junior?
How do you really identify a junior? Seems vague.13 -
What is your method of dealing with states in state machines? In programming, we often come across situations where we have to model states in our head as to not get the programming wrong, e.g. in my case right now:
You have a tabular webform that gets filled in.
Requirements:
- When the user is able to search the data for a specific value, it should be a cumulative search (e.g.: search for books with "eng" in the language and then with with "19" in the publishing date)
And so the current pseudocode is:
search(e) {
if(!word) {
set(previousState);
}
const searchdata = previousState.filter((row) => row.indexOf(word) != -1);
// but wait, what if I say: searchdata = searchdata.filter() for cumulative search? Oops, I can't, because it doesn't exist at that moment yet. What if I create another variable?
setState(data: searchdata);
}
Current bug:
- when deleting characters from the search field, it doesn't filter cumulatively; it just filters the data according to the current filter.
It's things like these that get me stuck sometimes.12