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
Search - "line wrap"
-
Do you ever feel coding fatigue?
My dev mana has run dry, I've hit my rate limit.
That moment where your brain thinks "I should finish building this React project, it's good for my portfolio" or "I should really work on fixing this query performance issue, I already know what the problem is" — but your stomach churns at the thought of having to interpret even a single line of code?
The last few days it really does feel like a physical illness, a nauseated feeling whenever I open an IDE. I have written about 12 lines of code since Monday.
It goes beyond writer's block, it's not a lack of focus or inspiration, it's a big knot in my head of everything that's wrong and inconsistent in development, and it causes feelings of dread, desperation and revulsion when trying to wrap my head around the simplest stuff.
Does anyone have good tips to overcome this feeling, something faster and less savings-account-destroying than "take a sabbatical year and travel the world riding an emu"? (seems tempting though)57 -
To improve our user's "experience" I suggested to my boss to add a status page showing...well, the current status of our services. Everybody was up for it, so I go off and implement a basic version + automated monitoring backend, get lots of positive feedback, all seems fine.
Then it starts:
Boss: "Can you get it all set up by this Saturday?"
Me: "Uh, today is Wednesday and I've never set up all the stuff needed on a proper server before"
Boss: "Well, you still have a few days. Please also contact your coworker to get it all hooked up in our launcher"
Me: "I'll try, can't make any promises though"
Contact my coworker and tell him what the plan is. I had already given him access to the repo and he is positive to get it all hooked up (I doubt he ever cloned my repo, let alone ran my code)
Spend all Friday getting my stuff set up on the production server, feeling pretty good thanks to the many tutorials.
Contact the boss Friday evening:
Me: "All up and running"
Boss: "Thanks, but we decided to go with a basic HTML page instead. We can just manually edit that, should be enough.
Me: "..."
In the end my stuff was never used, the server I set up was finally taken down a month ago. The gratitude you get when not hacking together some absolute shit that causes problems when you don't add <br/> tags at the correct places to prevent an ugly overflow, cause the coworker was too lazy to implement some form of line wrap in the launcher. I'm not saying my stuff is the best of the best, but at least it was professional looking to a certain extent.8 -
Just before you, my fellow system programmer, scroll past this, let me say this:
🍬 The web is actiually simple. 🍬
Both HTML and CSS is declarative. It's all easy when you understand the concepts, learn how to be idiomatic and quit trying to do that imperative bullshit in languages that aren't imperative.
HTML is simple. You know the boilerplate: doctype, head, body, that's all. Just mark it up and do NOT look at it before you end, mark it up as it were article or something. The appearance is up to css.
CSS is simple. You may even forget bem or rscss, you're already a skilled software developer. Use common sense and your code-splitting and naming skills you gained reading The Code Complete or doing software development for years.
Forget mockups. Forget absolute positioning, forget setting width and height in pixels. Go to awwwards, find some inspiration. Draw some buttons and fields on paper with your good old pencil. Then go and write some css. Feel free to steal some shadows and transitions from codepen.
Read about 8-pixel grid system. Let every element push away from others by setting something like margin: 16px; and whoops! You've just got fully responsive and got great vertical rhythm without even using media queries!
Oh my god, do NEVER set width and height explicitly! Type something like button { width: 120px; } and bang! The entire web page is broken. Quit that shit. Let it resize as it should. It will resize itself to fit its contents.
HTML is by default ready for your template engine. That's how you receive data from server — as server-side rendered, plain old HTML page. On the other hand, the form element is the most axiomatic and simple way to send the data to server. That's how you send it — as plain old GET or POST that every webserver can handle.
All of there are true:
1. It's easy to get great 100% responsiveness without media queries.
2. It's easy to align items in row, it's just one line of css. Maybe two, if you still want elements to wrap, but want to use flexbox:
.parent {
display: flex;
flex-wrap: wrap;
}
3. HTML and CSS are fast by default.
4. You don't need mockups to achieve great visual experience. Mockups is imperative, web is declarative.
5. You may not even need JavaScript to make great website.
Go on, ask me a question about web! I'll ready to answer everything.21 -
A small bug is found.
Chad dev:
😎 *Exists*
> Writes a simple ad hoc solution in a few lines
> Self documenting code with constant run time
> No external dependencies needed
> Fixes the bug, easy to test and does not introduce any new issues
That guy nobody likes (AKA. regex simp coder):
🤡 'This can be "simplified" into oNE LiNe'
> Writes a long regex expression that has to line wrap the editor window several times
> Writes an essay in the comments to explain it's apparent brilliance to the peasant reader
> Exponential run time (bwahahah), excessive memory requirements
> Needs to import additional frameworks, requires more testing that will delay release schedule
> Also fixes bug but the software now needs 2x ram to run and is 3x slower
> Really puts the "simp" in simplified, but not the way you would expect26 -
PM+UX: The boxes must stretch to fill the all the available width with no spaces in between, they must wrap to the next line, be 200px wide...sometimes.... and there should be no scroll bars all at the same time.
Me:so you want magic boxes that can just do whatever your thinking with no real logic defined...?1 -
Lets create a library.
Lets use that library in a project.
Lets wrap the library call in a wrapper functione to remove duplicate code.
Lets add an overloaded wrapper call that wraps the wrapper call that calls the library to partially undo the duplicate code removal.
Lets add another overloaded wrapper call that wraps the wrapper call that wraps the wrapper call that calls the library to partially undo the duplicate code removal.
How I love it. Not.
Sometimes redundancy makes sense, especially when it are two lines which make it obvious whats going on vs a single line that leads to a fuckton of overloaded wrapper functions.
Sheeesh.
Today in "code monkeys deserve divine punishment".
Another funny thing is creating a Helper class for Junit 5 tests, making it instantiable and adding to it all kinds of shit like testcontainer creation, applications instantiation, mocks, ....
... Then " crying " why the tests are so slow.
Yeah. Logic. Isolation of concerns, each test should be a stand alone complex.
But that would lead to redundancy... Oh no.
Better to create a global state god object.
Some devs... Really amaze me, especially when they argument in ways that makes one really wonder whether they are serious or just brain dead.14 -
I just want to share this:
When I start working at my last job, I have little idea of what a unit test was.
My boss on one meeting said that unit testing will be mandatory (wich is ok and umderstandable).
Almost a *year* after that, no one still care about them. I see myself doing them the best I can, but I saw things like wrap the assertion line with "try / catch" to lie to the coverage and unit test percentage. Or in other cases directly uploading *manually* the code on the server without test at all.
And then, as the only developer who do the unit test ok I have to do the missing ones and repair the fake ones.
Then when something explodes the question all the managers love to ask "Did we had the testing?"
At least I quit... that job was some crazy shit, this is just one story of many.
Like that other time that my co-workers did not understand why I needed to do POJOs on an android app because the big bad JSON that the app used was working fine.... -
The tons of undefined behaviour in C that ought to have been implementation defined instead, and increasingly sadistic compiler writers on the other side.
Like signed integer overflow that should just do what the underlying machine does, i.e. in practice, wrap around two's complement.
But the wierdest UB is when a C source code line has a non-matching ' or ". WTF, this should have been a compile time error!2 -
Am I the only developer in existence who's ever dealt with Git on Windows? What a colossal train wreck.
1. Authentication. Since there is no ssh key/git url support on Windows, you have to retype your git credentials Every Stinking Time you push. I thought Git Credential Manager was supposed to save your credentials? And this was impossible over SSH (see below). The previous developer had used an http git URL with his username and password baked in for authentication. I thought that was a horrific idea so I eventually figured out how to use a Bitbucket App password.
2. Permissions errors
In order to commit and push updates, I have to run Git for Windows as Administrator.
3. No SSH for easy git access
Here's where I confess that this is a Windows Server machine running as some form of production. Please don't slaughter me! I am not the server admin.
So, I convinced the server guy to find and install some sort of ssh service for Windows just for the off times we have to make a hot fix in production. (Don't ask, but more common than it should be.)
Sadly, this ssh access is totally useless as the git colors are all messed up, the line wrap length and window size are just weird (seems about 60 characters wide by 25 lines tall) and worse of all I can't commit/push in git via ssh because Permissions. Extremely aggravating.
4. Git on Windows hangs open and locks the index file
Finally, we manage to have Git for Windows hang quite frequently and lock the git index file, meaning that we can't do anything in git (commit, push, pull) without manually quitting these processes from task manager, then browsing to the directory and deleting the .git/index.lock file.
Putting this all together, here's the process for a pull on this production server:
Launch a VNC session to the server. Close multiple popups from different services. Ask Windows to please not "restart to install updates". Launch git for Windows. Run a git pull. If the commits to be pulled involve deleting files, the pull will fail with a permissions error. Realize you forgot to launch as Administrator. Depending on how many files were deleted in the last update, you may need to quit the application and force close the process rather than answer "n" for every "would you like to try again?" file. Relaunch Git as Administrator. Run Git pull. Finally everything works.
At this point, I'd be grateful for any tips, appreciate any sympathy, and understand any hatred. Windows Server is bad. Git on Windows is bad.10 -
I like my log messages to indicate automatically where in the code something happened, so that I can easily identify where a message originated from while tracking down problems.
In C/C++ this is nice and easy - write a logging routine, wrap it in macros for the different log levels and have that automatically output __FILE__, __LINE__ etc.
I wanted to do something similar in NodeJS, as I'd found myself manually writing the file name in the log message and then splitting functionality out into new files and it became a mess.
The only way I found to be able to do this was to create an "Error" object and access the "stack" member of it. This is a string containing a stack backtrace, suitable for writing to console/file. I just wanted the filename/line/routine.
So I ended up splitting the string into lines, then for each of the lines, trimming the surrounding spaces (or tabs?), and parsing them to see if the stack entry is inside my logger module. The first entry outside of that module must therefore be the thing that called it, so I then parse out the routine or object and method, filename and line number.
It's a lot of clumsy work but the output is pretty neat. I just wish it were simpler!2 -
New job is turning out to be kind of the opposite of what I was expecting, based on interviews.
I thought I had done a pretty thorough job asking the kinds of challenging and specific questions during the interviews and was pretty satisfied with the answers.
Three weeks in, I’ve more or less been turned loose onto my first project which is….installing patch updates.
Next few projects through the end of the year and into Q1 next year are similarly sysadmin-chore work, which I’m not going to act like is beneath me or unimportant but it’s not quite what we talked about in the interview when I applied to an SDET position.
Point of order to talk about once I wrap up these first few projects, it doesn’t exactly seem like they know where I’m supposed to be or where to even really put me (on the org chart I have a line reporting up to boss, but I’m also the only one not on a functional team) and reading through the wiki last guy just kind of did everything.
If that’s what this is….eh I need to know if that’s how they want to use me and find out soon.11 -
Ok, so: I have a macbook for work. And for the most part, I love it. Its a good looking device that has a fast cpu, enough ram to run stuff locally for testing, even multiple services / environments at the same time without getting overly sluggish.
And, the best thing: It isn't Windows. I have a good, working shell (zsh), so I can use all the command line tooling I could wish for, I have a somewhat working package manager and everything.
But there are just some little things I really can't wrap my head around. And since everything is so locked in by Apple, there are no sensible ways to fix those things without having a bunch of extra programs / services running all the time, introducing overhead, configuration for things I neither want nor need, and so on.
First of all, why the hell did you think the normal way of typing "@" on a german iso keyboard is the key combination for closing the currently focused application? I am a daily user of macos for over 2 years now, and I still keep quitting applications regularly, almost every day.
Or, scroll direction: I use a mouse (g pro wireless) and not just the touchpad, but when I am in a meeting or something (or when I take my macbook with me to configure a switch that isn't accessible over the network), I don't want to take the mouse with me, the touchpad is pretty good, it is big, precise and everything. But for some dumb reason, they decided to reverse the scroll direction for the mouse by default, so if you change that to use the mouse like a normal person, it also changes the scroll direction for the touchpad. And, the worst part is: there doesn't seem to be ANY easy way to separate those two settings, or to automatically set the scroll direction when a mouse is connected.
So every time I use my laptop somewhere else, wich also happens regularly, the scroll directions is wrong, which means I have to go into the settings, change it, then change it back when I am at my desk again.
It just doesn't make any sense, stop trying to "know what our customers want", and please, dear Mr. Tim Apple, give your customers the freedom to know for themselves what they want.
Thanks for listening to my TED Talk.8 -
It's CSS quick maffs time! Consider the following code:
<div class='container flex'>
<nav class='menu flex'>
<a href='#'>Menu item 1</a>
(arbitrary amount of links)
</nav>
<button type='button'>Sign in</button>
</div>
You want the layout to look like a horizontally scrolling, single line menu with a Sign in button to the right. Both container and menu are flex containers. So, here's the code for the menu:
.menu {
overflow: auto;
}
The problem is, as there is no flex-wrap, menu will not be wrapped, and it will occupy all the space it's needed to accommodate all the elements, breaking its container. Pesky horizontal scroll appears on the whole body.
Boubas will set menu's width to some fixed value like 800px, and this is a bouba approach because bye-bye responsiveness.
Here's what you should do:
.menu {
overflow: auto;
min-width: 0;
}
.menu * {
flex-shrink: 0;
}
This way, menu will occupy exactly the width of an empty div. In flexbox, its width will be equal to all free space that is not occupied by the Sign in button. Setting flex-shrink is needed for items to preserve their original width. We don't care about making those items narrower on narrower screens, because we now have infinite amount of horizontal real estate. Pure, inherent responsiveness achieved without filthy media queries, yay!
The menu will scroll horizontally just like you wanted.
aight bye14 -
When you have a long line like this...
if ($obj->getStupidlyLongNamedThing() + $hard + $harder * $hard / $harder + $obj->getAlsoStupidLongThing([$sillyLongExpression, $thing]) > $obj->omgThisIsInsane());
If you're just going to be lazy and break it up however where where ever so it looks like crap...
if ($a->b()
____&& $a->c());
Then I urge you to do one of two things:
* Shut up your face and turn on word wrap in the IDE rather than manually doing it even worse.
* Break the long parts into variable assignments or something.
* (or get a wider screen)
Example:
$a = $obj->getStupidlyLongNamedThing();
$b = $hard + $harder * $hard / $harder;
$c = [$sillyLongExpression, $thing];
$d = $obj->getAlsoStupidLongThing($c);
$e = $obj->omgThisIsInsane();
if ($a + $b + $d > $d);
With sensible variable names.3 -
Folks should give Clojure a look. It may be Lisp on steroids. Need to wrap your brain around macros to use it properly. It's interpreted so it must be slow, riiight?
Not so, er, fast.Ran across a discussion re C++ vs Clojure running data acquisition at 100 MBPS or better. Bottom line, original Clojure code was sped up 76.6x and blew the doors off the C++ code.
Be warned, a number of optimization steps were required. The end result blew me away. Had a link I wanted to insert but it's not on my phone and I may have re-installed Linux wiping it out. Have looked for the post for hours, no joy.
https://clojureverse.org/t/...6 -
I don't even know if the shitty rant gets through this unreliable service I pay for with my money. I want to fucking wrap my hand in that money, light it up and fucking beat your teeth out while shoving this fucking money down your greedy, second arseholes. Honestly, what am I paying you for. These last couple of days your service was less reliable than a drunkard behind the wheel trying to drive in a straight line. Exactly this fucking week where there's a fucking hackathon. This very fucking week l where I got to be the team leader, you make me look like a fucking unreliable internet twat who just talks big. This very fucking week I'm given a internet service that doesn't even let me communicate with my team mates. Why do you dare to display fucking 3g? Is the the force my fist should take? Is it the fucking amount of gallons of acid you want to be showered with? Well fucking pay that shit with the money you earned. Just let me fucking work, let me give my best, give me a fucking way to look at the docs, give me a fucking way to test my code (chat bot), give me a fucking way to tell you to go fuck yourself using your fucking antennas, maybe thst will help.
Kindly, a pissed of customer who's rage makes the heatwave look like a lesser evil.1 -
I know there is this huge argument about whether to use tabs or 4 spaces and while I'm on neither side, just sitting there using tabs, in this new project I'm FORCED to use a 1 space indentation and no line breaks in Android layout XML files format.
I sat there for about 10 minutes trying to wrap my head around d this absurd specification they agreed upon with the client. The code looks SHIT and every time I copy some beautifully formatted reference code into this project it turns into a piece of unreadable garbage.
But since I'm just a part-timer and the senior developer working on this project for some years now is much more experienced than me, I'm hesitant to criticise it more than I already did.
Maybe I'll start arguing with industry standards and the improvement for new developer to read our code... -
Another day, another struggle with time zones.
How many fucking helper methods do I need to create for dates and time zones? How many components, pipes and services do I need to wrap just so two datetimes line up? Apparently another one today. At this point I'm ready to accept flat earth theory if it means no more time zones. I'm fucking sold on it if so.
It's not even the time zone that's the issue. It's business needing it formatted, but also offset properly, based on your browser locale, but with points that cross into DST observing time zones of a different locale simultaneously. Sometimes those times are the same, sometimes they're different, sometimes they're different but only in winter. And despite a plethora of libraries to help with these calculations, nothing ever seems to just work out of the box. So here's to another layer of abstraction, because time zones (and DST) are bullshit.1 -
How to Create Beautiful and Durable Pie Boxes
Whether you are looking for a unique gift to give, or you are looking to protect the delicate items you hold, there are many ways to do so with the right pie boxes. By using a custom designed box, you can capture the essence of the delicacies you are storing and protect them for a longer period of time.
Protect delicate items
Using pie boxes is a good way to protect delicate items such as pies, cakes and desserts. However, you need to be sure that the box is the right size and shape to ensure that your item is safely packed. If you don't pack your delicate products properly, they could suffer from moisture and change in temperature.
Before you begin packing your goods, consider whether you should use bubble wrap or paper. While bubble wrap provides an extra layer of protection, it can also leave your product vulnerable to scratching. Choose paper to wrap your items, as it will prevent scratches and will keep them from shifting during transport.
When wrapping fragile items, you need to use a lot of packing tape to secure your package. You should also fill any empty space in the box. You can do this by using bubble wrap, or by adding extra padding. Make sure to mark your box as fragile and to place a label with your name and delivery address on all sides of the box.
Once you've completed the packaging process, you need to seal the box and place it in the shipping box. Besides bubble wrap, you may also want to include ice packs to add extra protection. A cushioned ice pack is another option for additional protection.
You should also use quality packing tape, and make sure to cover all the openings of your box. You can also use zip-up bags to help you keep your things in place.
It is important to know the best way to protect delicate items, so you can prevent them from damage during the shipping process. There are many ways to do this, but you should use the right tools for the job. Purchasing a box that is the right size and shape for your items is the most effective way to do it.
When you use custom pie boxes, you can rest assured that your pies, chocolate pies and other edibles will be safe. They're manufactured with modern equipment and environmentally friendly printing techniques.
Make a gift
Whether you are giving a pie for a birthday, wedding, or as a thank you gift, you can make pie boxes that are beautiful and durable. Several pie box designs are available online, but you can also create your own. Here are some simple instructions to make a simple, yet elegant box.
The first step is to print out a template of a pie box. You can use a piece of scrap paper or decorative paper for your design. If you are using decorative paper, cut out a rectangle the size of your box. If you are using colored cardstock, you will need to cut out a pie filling layer. Once you have a pie filling layer, copy it for several boxes. You can also add other designs or embellishments to your boxes.
Next, place your colored cardstock on your cutting mat. With your x-acto knife, cut out a rectangle that is as large as your box. You will need to fold it on the dotted line. If you are using an x-acto knife, it will be easier to fold the box. Alternatively, you can use a scoring stylus. If you have a Cricut, you can score the cardstock to make a scalloped box top. You can also use burlap ribbon or twine to wrap your box.
Once you have the box finished, you can decorate it with other decorations or embellishments. You can even use calligraphy or other techniques to make the box more special. To close the box, you will need a sticker or piece of tape. You can decorate the lid with patterned paper and a clear plastic screen. This will allow you to see the contents of your pie. You can also use embellishments such as ribbon, glitter, or other materials to make the box more fun.
If you are giving a pie for a holiday or party, you can decorate your box with a festive theme. For example, you can have a holiday tree on the front of your box. Or, you can dress it up for a tailgate party.2