Do all the things like ++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatarSign Up
Get a devDuck
Rubber duck debugging has never been so cute! Get your favorite coding language devDuckBuy Now
Search - "too verbose"
Spaces Vs Tabs - A real world case.
So one of the menial tasks I was given here was to take a pretty mock and turn it into an HTML email template. Needless to say, I hate emails and HTML.
After many weeks of trial and error, rejection and tweaks, we're doing our final tests when someone noticed that Google's clients are chopping off the footer and saying "View Full Email".
A few searches yield that Google has a 102KB cut off for email size. We did some checks and found that we were at 104KB. I immediately thought it was my CSS inliner being a little too verbose, but as I went in to edit things, I noticed that the file was intended with spaces!
Now I'm a fan of Silicon Valley, and I recalled an episode from this past season where Richard mentioned something about saving file size by using tabs. I had never really considered that point.
So I went back into VSCode and told it to convert all of the individual templates that make up this giant email to indent with tabs...
The file size dropped from 104kb to 82kb.
I wasn't very polarized on the Tabs vs Spaces debate, but this here has given me a nice real world example as to why tabs rule.22
And fUCK ME WHY NOT PYTHON?? It's a weak typed but dynamic language that FORCES good indentation and actually has ACCESS TO THE FILE SYSTEM instead of just the web APIs that don't let you do SHIT compared to what you SHOULD learn.
Fuck you Stanford, I expected better you shitty cockmunchers.32
The GashlyCode Tinies
A is for Amy whose malloc was one byte short
B is for Basil who used a quadratic sort
C is for Chuck who checked floats for equality
D is for Desmond who double-freed memory
E is for Ed whose exceptions weren’t handled
F is for Franny whose stack pointers dangled
G is for Glenda whose reads and writes raced
H is for Hans who forgot the base case
I is for Ivan who did not initialize
J is for Jenny who did not know Least Surprise
K is for Kate whose inheritance depth might shock
L is for Larry who never released a lock
M is for Meg who used negatives as unsigned
N is for Ned with behavior left undefined
O is for Olive whose index was off by one
P is for Pat who ignored buffer overrun
Q is for Quentin whose numbers had overflows
R is for Rhoda whose code made the rep exposed
S is for Sam who skipped retesting after wait()
T is for Tom who lacked TCP_NODELAY
U is for Una whose functions were most verbose
V is for Vic who subtracted when floats were close
W is for Winnie who aliased arguments
X is for Xerxes who thought type casts made good sense
Y is for Yorick whose interface was too wide
Z is for Zack in whose code nulls were often spied
- Andrew Myers6
Is it just me who sees this? JS development in a somewhat more complex setting (like vue-storefront) is just a horrible mess.
I have 10+ experience in java, c# and python, and I've never needed more than a a few hours to get into a new codebase, understanding the overall system, being able to guess where to fix a given problem.
But with JS (and also TS for that matter) I'm at my limits. Most of the files look like they don't do anything. There seems to be no structure, both from a file system point of view, nor from a code point of view.
It start with little things like 300 char long lines including various lambdas, closures and ifs with useless variables names, over overly generic and minified method/function names to inconsistent naming of files, classes and basically everything else.
I used to just set a breakpoint somewhere in my code (or in a compiled dependency) wait this it is being hit and go back and forth to learn how the system state changes.
This seems to be highly limited in JS. I didn't find the one way to just being able to debug, everything that is. There are weird things like transpilers, compiler, minifiers, bablers and what not else. There is an error? Go f... yourself ...
And what do I find as the number one tipp all across the internet? Console.log?? are you kidding me, sure just tell me, your kidding me right?
If I would have to describe the JS world in one word, I would use "inconsistency". It's all just a pain in the ass.
I remember when I switcher from VisualStudio/C# to Eclipse/Java I felt like traveling back in time for about 10 years. Everyting seemd so ... old-schoolish, buggy, weird.
When I now switch from java to JS it makes me feel the same way. It's all so highly unproductive, inconsistent, undeterministic, cobbled together.
For one inconveinience the JS communinity seems to like to build huge shitloads of stuff around it, instead of fixing the obvious. And noone seems to see that.
It's like they are all blinded somehow. Currently I'm also trying to implement a small react app based on react-admin. The simplest things to develop and debug are a nightmare. There is so much boilerplate that to write that most people in the internet just keep copying stuff, without even trying to understand what it actually does.
I've always been a guy that tries to understand what the fuck this code actuall does. And for most of the parts I just thing, that the stuff there is useless or could be done in a way more readable way. But instead, all the devs out there just seem to chose the "copy and fix somehow-ish" way.
I'm all in for component-izing stuff. I like encapsulation, I'm a OOP guy by heart. But what react and similar frameworks do is just insane. It's just not right (for some part).
Especially when you have to remember so much stuff that is just mechanics/boilerplate without having any actual "business logical function".
People always say java is so verbose. I don't think it is, there is so few syntax that it almost reads like a prose story. When I look at JS and TS instead, I'm overwhelmed by all the syntax, almost wondering every second line, what the actual fuck this could mean. The boilerplate/logic ration seems way to off ..
So it really makes me wonder, if all you JS devs out there are just so used to that stuff, that you cannot imagine how it could be done better? I still remember my C# days, but I admin that I just got used to java. So I can somehow understand that all. But JS is just another few levels less deeper.
But maybe I'm just lazy and too old ...5
Today's project was answering the question: "Can I update tables in a Microsoft Word document programmatically?"
My coworker got the ball rolling by showing that the docx file is just a zip archive with a bunch of XML in it.
The thing I needed to update were a pair of tables. Not knowing anything about Word's XML schema, I investigated things like:
- what tag is the table declared with?
- is the table paginated within the table?
- where is the cell background color specified?
Fortunately this wasn't too cumbersome.
For the data, CSV was the obvious choice. And I quickly confirmed that I could use OpenCSV easily within gradle.
The Word XML segments were far too verbose to put into constants, so I made a series of templates with tokens to use for replacement.
In creating the templates, I had to analyze the word xml to see what changed between cells (thankfully, very little). This then informed the design of the CSV parsing loops to make sure the dynamic stuff got injected properly.
I got my proof of concept working in less than a day. Have some more polishing to do, but I'm pretty happy with the initial results!6
I just wrote a long-ass rant and deleted right away because it was, again, a FUCKING WALL OF TEXT.
I fucking need to learn to summarize my thoughts.
I'll write it again another day, and I think I could even divide it into two rants.
PS : that was a rant about my fucking verbose mind, so no category problem here.2
I'm shitting there hammering out some code butchering some real problems when I suddenly realise I'm surrounded. I look around and yes it's the bloody committee.
The committee is what I call the rest of the department and it is dominated by the old guard which comprises of the programmers that have been around for longer.
None of the old guard can program particularly well but because they had been around the longest they'd all grown senior. The committee had free reign but anyone else doing anything differently has to get approval from the committee.
The only way to code otherwise was to copy and paste existing code then to primarily rename things. If anyone did anything that hadn't been seen before then it would have to be approved by the committee. Individual action was not permitted unless you were old guard.
I swept my headphones away expecting it to be something unimportant. It was.
First things first they announce. We're going to add extraneous commas to the last element of all possible lists separated by comma including parameters or so they say. Ask but why so I do.
Because the language now supports it. They added support for it so it must be the right way someone proclaimed. Does it? I didn't realise we were waiting for it. Why do we want it though?
Didn't you hear? It's all over the blogosphere. It massively improves merge requests. But how I ask?
Five minutes later I grow tired of the chin stroking, elbow harnessing, slanted gazes into the yonder and occasionally hearing maybe its because and ask if they mean when you for example add an element the last element registers as changed from adding a comma. Turns out that's all it is.
How often do we see that tiny distraction and isn't it pointless to make the code ugly just for a tiny transient reduction in diff noise I ask. Everyone's stumped. This went on and on and got worse and worse. But it makes moving things around easy half of them say in unison like the bunch of slobs that they are. I mean really. It doesn't make expanding and contracting statements from multiline to single line easy and it's such a stupid thing. Is that all they do all day? Move multi-line method parameters up and down all day? If their coding conventions weren't totally whack they wouldn't have so many multiline method prototypes with stupid amounts of parameters with stupidly long types and names. They all use the same smart IDE which can also surely handle fixing the last comma and why is that even a concern given all the other outrageously verbose and excessive conventions for readability?
But you know what, who cares, fine, whatever. Lets put commas all over the shop and then we can all go to the pub and woo the ladies with how cool and trendy we are up to date with all the latest trends and fashions then we go home with ten babes hanging off each arm and get so laid we have to take a sick day the following to go to the STD clinic. Make way for we are conformists.
But then someone had to do it. They had to bring up PSR. Yes, another braindead committee that produces stupid decisions. Should brackets be same line or next line, I know, lets do both they decided. Now we have to do PSR and aren't allowed to use sensible conventions.
But why, I ask after explaining it's actually quite useful as a set of documents we can plagiarise as a starting point but then modify but no, we have to do exactly what PSR says. We're all too stupid apparently you see. Apparently we're not on their level. We're mere mortals. The reason or so I'm told, is so that anyone can come in and is they know PSR coding styles be able to read and write the code. That's not how it works. If you can't adjust to a different style, a more consistent style, that's not massively bizarre or atypical but rather with only minor differences from standard styles, you're useless. That's not even an argument, it's a confession that you've got a lump of coal where your brain's supposed to be.
Through all of this I don't really care because I long ago just made my own code generators or transpilers that work two ways and switch things between my shit and their shit but share my wisdom anyway because I'm a greedy scumbag like that.
Where the shit really hit the fan is that I pointed out that PSR style guide doesn't answer all questions nor covers all cases so what do we do then. If it's not in PSR? Then we're fucked.4
I've decided to take a look at flutter today and boy... I must say I hate writing layout for it.
Not cause of all those margin thing no.. It's just too verbose, awful.
I don't want to spend that much time writing the UI, I want to focus on the logic.
Even XML was better than that.
I think I'll wait for a layout editor before coming back to it.
But I have to admit that hot reload is really nice after spending so much time waiting for my builds on Android 😓7
What web charting lib are you using ?
I tried canvasjs, chartjs, google chart..
And for the moment i love Echart, not too verbose1
I legit never understood the hate for VB.NET in the land of Microsoft development. To be entirely fair, I only used it it that one class at uni. But other than that I had never used it in the real world. The closest thing I had done with BASIC was VBScript, and even tho I was ok with it(even liked it) I damn well know that it is not something that I would use to build web apps with anymore.
But I am inclined to give VB.NET a chance only because I remember being able to make sense of my peers code in school. Just by reading it, sure it might be verbose as all fucking hell, but we were using VS(notice that i said VS not VS Code) and we had all the bells and whistles of autocomplete and intellisense.
Currently tho, I somewhat wanted to try a more modular approach to my fucking around with web apps, we are considering Rails and Django for a project at work. But since we already have windows servers we thought about the possibility of using .net core. We all like C# as a language and I did work with ASP.NET MVC before so we are considering that as well. That and our sys admin had tons of experience setting that as an environment. When developers are not too sure it is good to rely on the admin's expertise.
IMAGE COMPRESSION QUESTION
lets say i upload a 100x100 photo from my android device. this image has a size of e.g. 2MB. not a lot. if i compress it then the size will be e.g. 300kB. cool. upload is thunderbolt for any internet speed.
lets consider this case. a random ass motherfucker decides it is cool to upload a 10000x10000 image that has a size e.g. 300MB. compressing this would be e.g. 150MB which is still a lot as fuck for one pic.
heres my question: where should the compression be handled? at backend (REST API server) or client (android image compression library)?
because if i try to send a 150MB pic to the server and their internet sucks but to be fucking honest even the best internet speed would take way too long to upload, is it better to do the compression on the backend or client?
or should i do compression in android? if i should do compression on client then should i;
1) do the compression on the main thread with a progress dialog to wait them until the compression + PLUS the fucking upload is done or
2) do the compression + THE upload in a background thread in which case it can be dangerous for verbose amount of fuckups (internet dies phone explodes etc) and the app crashes
which (one) option of the 2 suboptions from the second parent option branch?
of course this is an extremely unrealistic case, it is possible but thats not my point: my point is WHERE SHOULD THE COMPRESSION (as some kind of universal standard) BE HANDLED AT?6
Sometimes as an intern I legitimately have no work to do and I feel awful about it. Sitting here twiddling my thumbs makes me feel like I'm doing something wrong. You can only ask for work so much... Trying to find things on our backlog to work on but they're all unfinished/not ready or too verbose / require too much for me to take on.
Mmmmehhhh I don't know what to dooooo3
Python is an example of a language which is far, far too high-level for my liking; to provide a reference for my preference, C++ is one of my favourite languages, because it is versatile while remaining somewhat verbose, while Python tosses that verbosity out of the window while not functioning as one would expect it to function after reading a lot of the documentation.3
As a Java developer, I’m used to being verbose. Probably a little bit too used to being verbose.
My Literature teacher reflected on how verbose all my writing is, and I could not help but laugh at the irony.
I know a lot of people aren't fans of Microsoft here, but does anyone have some extended experience with using powershell?
I've been using it for creating a script that handles quite a large set of tasks for setting up and configuring some application servers and so far I have been really digging the language. Being able to invoke the script against remote hosts in parallel like ansible has been a really cool learning experience.
Admittedly it's verbose as fuck, so getting the same thing done in something like python/perl might be like half the lines of code. And I know that some of the commands illicit a "WTF?" every now and again. But I think one of the powershell tutorials I watched early on in attempting this helped make using powershell not suck ass.
Every command is basically 'verb-noun'. You don't know what the command or switches are:
> get-help "command" -showwindow
It will give you a list of options if you didn't select the exact command with get-help.
It feels* amazingly buttoned up as a scripting language and it's really cool to be able to take advantage of lower level stuff, like you can run alternative shells (we have cygwin installed on some of our servers), you can run C# code, you have access to interfacing with .NET api's. I haven't messed with anything azure yet, but being able to interface with products and services like SQL/Exchange/O365/azure/servers/desktops from the same language seems pretty cool.
Admittedly, the learning curve feels terrible though. I felt like a dunce for the first couple weeks, couldn't navigate the language at all, and was always in the docs trying to figure stuff out. I think I just needed to understand how the people developing powershell intended for it to be used. Once I was able to put two-and-two together about the verb-noun structure and how to find information/examples about the cmdlets it's been quite easy to work with it.
If anyone else has any extended experience with it, please share your thoughts/opinions. Curious to see if your experiences are/were similar to mine.
If you don't have Powershell experience, please feel free to share your opinions of Micro$haft and me for using Micro$haft products too! It's all good 😎11
Sydochen has posted a rant where he is nt really sure why people hate Java, and I decided to publicly post my explanation of this phenomenon, please, from my point of view.
So there is this quite large domain, on which one or two academical studies are built, such as business informatics and applied system engineering which I find extremely interesting and fun, that is called, ironically, SAD. And then there are videos on youtube, by programmers who just can't settle the fuck down. Those videos I am talking about are rants about OOP in general, which, as we all know, is a huge part of studies in the aforementioned domain. What these people are even talking about?
Absolutely obvious, there is no sense in making a software in a linear pattern. Since Bikelsoft has conveniently patched consumers up with GUI based software, the core concept of which is EDP (event driven programming or alternatively, at least OS events queue-ing), the completely functional, linear approach in such environment does not make much sense in terms of the maintainability of the software. Uhm, raise your hand if you ever tried to linearly build a complex GUI system in a single function call on GTK, which does allow you to disregard any responsibility separation pattern of SAD, such as long loved MVC...
Additionally, OOP is mandatory in business because it does allow us to mount abstraction levels and encapsulate actual dataflow behind them, which, of course, lowers the costs of the development.
What happy programmers are talking about usually is the complexity of the task of doing the OOP right in the sense of an overflow of straight composition classes (that do nothing but forward data from lower to upper abstraction levels and vice versa) and the situation of responsibility chain break (this is when a class from lower level directly!! notifies a class of a higher level about something ignoring the fact that there is a chain of other classes between them). And that's it. These guys also do vouch for functional programming, and it's a completely different argument, and there is no reason not to do it in algorithmical, implementational part of the project, of course, but yeah...
So where does Java kick in you think?
Well, guess what language popularized programming in general and OOP in particular. Java is doing a lot of things in a modern way. Of course, if it's 1995 outside *lenny face*. Yeah, fuck AOT, fuck memory management responsibility, all to the maximum towards solving the real applicative tasks.
Have you ever tried to learn to apply Text Watchers in Android with Java? Then you know about inline overloading and inline abstract class implementation. This is not right. This reduces readability and reusability.
Have you ever used Volley on Android? Newbies to Android programming surely should have. Quite verbose boilerplate in google docs, huh?
Have you seen intents? The Android API is, little said, messy with all the support libs and Context class ancestors. Remember how many times the language has helped you to properly orient in all of this hierarchy, when overloading method declaration requires you to use 2 lines instead of 1. Too verbose, too hesitant, distracting - that's what the lang and the api is. Fucking toString() is hilarious. Reference comparison is unintuitive. Obviously poor practices are not banned. Ancient tools. Import hell. Slow evolution.
C# has ripped Java off like an utter cunt, yet it's a piece of cake to maintain a solid patternization and structure, and keep your code clean and readable. Yet, Cs6 already was okay featuring optionally nullable fields and safe optional dereferencing, while we get finally get lambda expressions in J8, in 20-fucking-14.
Java did good back then, but when we joke about dumb indian developers, they are coding it in Java. So yeah.
To sum up, it's easy to make code unreadable with Java, and Java is a tool with which developers usually disregard the patterns of SAD.
I HATE dealing with Map objects in Java. Much like everything else in Java, the API is far too verbose. What's more annoying is how Oracle seems unbothered to improve it.5
Some really motivated guy.
He apparently wants to monitore his opensource application on his spare time.
His application is likely to have no users though.
But well, that guy looks like kinda montivated.
For professional purpose, guy already did monitore with newrelic.
Seems like he was not satisfied and switched to datadog 3 years ago.
But liking digging dirt, he migrated to self hosted telegraf/influx/grafana (which he likes to about)
Today that guy is not in his company but on his potatoe machine in the cloud. So he wants to be minimalistic, datadog should do.
Now you got it, random ff*** is me, on a weekend, a shinny saturday for that matter.
Actually now it is night.
Now let's start the fight.
I have datadog scripts!
But datadog be sneaky as well. datadog upgraded to v6 8=)
-> scripts ain't working. outdated.
I check the logs. Too bad!
-> datadog removed dogstatsD.log in v6!
Well I have nothing to do in my life it is too cold outside as they say. I read the (sluggy) datadoc and tries some shell command (given in doc) to upload some events to dogstatsd (via udp).
-> Nothing happens, neither in local nor in remote.
ok maybe command not up to date, so let me try some official library. datadog from python. Feels like a nice try!
-> only available for python >= 3.5. 3.4 on my good ol' jessie. Upgrading os for datadog not acceptable.
Maybe dogstatsD not started... doc says it is by default, but well, not the first time doc is wrong... I put datadog as log verbose. Guess what: as per standard: shitload of error.
Digging... kubexx, docker and whatsoever apparently preventing collector to do its normal stuff
np, I am gonna check that on github! Goog, people have the same errors. They seem to fix it by trying some settings, with. or without luck
-> I am not that warrior to check every stuff
Ok, let's stop the datadog events, it works. It does not anymore. You know that sentence. We all know it.
Still not enough!
How about testing that uber super nice feature of v6. The logs. After all I want to make events out of my applicative logs.
How about reading the log again. Configure the yaml log as they say. Done. Make some pattern. Read the best practive. Done. Configures the yaml. Done. Now testing.
-> remote datadog interface be like: no logs for you dude you need to pay
Fuck datadog, fuck that v6 version, good old tail -Fxx | someaggreate.js|sendmail will do...