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 - "python-does-not-make-sense"
-
Usually I develop in python, mongo, cordova and node. Few days back I installed Windows on my laptop cause I needed to use the Visual Studio for a specific task. Then I thought that if I can setup the python, mongo, cordova and node stack on Windows then I don't need to switch between Linux and Windows frequently. And that was a horrible decision.
It took almost 8-10 hours to setup that shit, and still I couldn't make it work. There are so much complexities and those do not make any fucking sense! I mean why the hell I need to add the python path to the environment variables, and then again add the pip path separately. Then mongodb can not autostart. And finally I needed to make and build a package, and that waa the moment when I just scrapped it.
It takes me 2-3 hours to setup a fresh Linux box (which supports apt) including the OS installation. Same for the osX. I still wonder that why Microsoft does this! If Windows is for non-dev and non-tech people then why don't they release a Windows developer edition? Developing anything except ASP.NET and Java in Windows is a fucking nightmare for me!11 -
Today on "How the Fuck is Python a Real Language?": Lambda functions and other dumb Python syntax.
Lambda functions are generally passed as callbacks, e.g. "myFunc(a, b, lambda c, d: c + d)". Note that the comma between c and d is somehow on a completely different level than the comma between a and b, even though they're both within the same brackets, because instead of using something like, say, universally agreed-upon grouping symbols to visually group the lambda function arguments together, Python groups them using a reserved keyword on one end, and two little dots on the other end. Like yeah, that's easy to notice among 10 other variable and argument names. But Python couldn't really do any better, because "myFunc(a, b, (c, d): c + d)" would be even less readable and prone to typos given how fucked up Python's use of brackets already is.
And while I'm on the topic of dumb Python syntax, let's look at the switch, um, match statements. For a long time, people behind Python argued that a bunch of elif statements with the same fucking conditions (e.g. x == 1, x == 2, x == 3, ...) are more readable than a standard switch statement, but then in Python 3.10 (released only 1 year ago), they finally came to their senses and added match and case keywords to implement pattern matching. Except they managed to fuck up yet again; instead of a normal "default:" statement, the default statement is denoted by "case _:". Because somehow, everywhere else in the code _ behaves as a normal variable name, but in match statement it instead means "ignore the value in this place". For example, "match myVar:" and "case [first, *rest]:" will behave exactly like "[first, *rest] = myVar" as long as myVar is a list with one or more elements, but "case [_, *rest]:" won't assign the first element from the list to anything, even though "[_, *rest] = myVar" will assign it to _. Because fuck consistency, that's why.
And why the fuck is there no fallthrough? Wouldn't it make perfect sense to write
case ('rgb', r, g, b):
case ('argb', _, r, g, b):
case ('rgba', r, g, b, _):
case ('bgr', b, g, r):
case ('abgr', _, b, g, r):
case ('bgra', b, g, r, _):
and then, you know, handle r, g, and b values in the same fucking block of code? Pretty sure that would be more readable than having to write "handeRGB(r, g, b)" 6 fucking times depending on the input format. Oh, and never mind that Python already has a "break" keyword.
Speaking of the "break" keyword, if you try to use it outside of a loop, you get an error "'break' outside loop". However, there's also the "continue" keyword, and if you try to use it outside of a loop, you get an error "'continue' not properly in loop". Why the fuck are there two completely different error messages for that? Does it mean there exists some weird improper syntax to use "continue" inside of a loop? Or is it just another inconsistent Python bullshit where until Python 3.8 you couldn't use "continue" inside the "finally:" block (but you could always use "break", even though it does essentially the same thing, just branching to a different point).19 -
I threw an error into my code to find where the code was having trouble but instead of raising and error it fixes the problem and runs flawlessly
At this point I can't tell if python loves me or hates me2 -
I'm going to try a 'zero-day' strategy for learning c++ (at first I was also a little confused about the term zero-day).
The name zero-day does make sense in that there are zero days of me not doing x
So, for this strategy, I have to program something (doesn't matter how small) in c++ every day for a month. After that I'll do the same for python
Then I can make an educated decision of what programming language I like the most
I want to thank @teganburns for his c++ video about c++, that's the reason why I chose to try c++ first4 -
Well this is the thing. I have been starting to replace a lot of my shit with Golang. I think it is a great language because of one small fact: it is a boring language.
With this I don't mean that it is not incredibly fun to use. It is and honestly I feel that a lot of the concepts that I had from C passed quite nicely with some additions. The language does not do anything special and there is no elegant code. It works in a very procedural fashion without taking into consideration any of the snazzy things found in JS, Python, c# etc etc. Interfaces and struct make sense to me, way more than oop does in other languages. I don't need generics with the use of interface parameters and I have hadly found a situation in which I have to strive too far away from the way things are done with Go to be happy with it, then again my projects are not hard or by any means groundbreaking (most of them deal with logistics or content management and a couple of financial apps that I am rewriting in Go from work)
The outcome is fast and easy to read since idiomatic go is for the most part very readable(no people...single letter variable names are by no means a standard and they should feel ashamed from it)
I miss the idea of a framework, but not so much and the docs and internal code for Go is just way top inviting. I believe the code to be readable enough than anyone that has gotten used to the syntax and ideas of the language can just jump in and start learning. This is the first language that I have learnt from studying the code as it is inside of the standard lib, the same I cannot say for any other language or framework.
Also, it play beautifully nice with vs code.
I dunno man, I feel that I am doing something wrong. I have projects built in Node, php, python, ruby and spring java as well as .net core and I still find Golang way more appealing simply because it goes harder than Python with "one preferred way" to do things.
The lang does not make me feel like a pro, i certainly develop in it at pro speeds, but it was made with beginners in mind to built fast and concurrent apps, with the most minimal syntax possible.
I guess my gripe with it is that it gets shunned from this, saying that it ignored years of lang research to make it as dumbed down as possible. Which it did, lack of generics amongst other things certainly make it seem like, but I will not say that it was poorly designed. Not at all, I believe it is a testament of amazing engineering. To be able to create such a simple yet amazingly powerful language.
Wish there were more to it. Wish there was a nice gui lib or a ml framework comparable to the ones offered by python and java. But I guess such things will come with time.
I feel stupid with this language.
And that is fine.5 -
There are a couple:
A system that updates user accounts to connect them into our wifi system by parsing thousands of processing files written in Clojure. The project was short lived and mainly experimental, It has complete test cases and the jar generated from it is still purring silently on the main application. It was used to replace an $85k vendor application that made no fucking sense. The code has not been touched in 2 years and the jar is still there. The dba mentioned the solution to the vendor, the vendor tried buying it from me, but being that it belongs to the institution nothing was touched, still, it got the VP's attention that I can make programs that would be bought for that level, it caught his attention even more when I showed him the codebase and he recognized a Lisp variant (he is old, and was back in the day a Fortran and Cobol developer)
A small Python categorical ML program that determines certain attributes of user generated data and effectively places them on the proper categories on the main DB. The program generates estimates of the users and the predictions have a 95% correctness rate. The DBA still needs to double check the generated results before doing the db updates. I don't remember how I coded it because I was mostly drunk when I experiment on the scenario. It also got the attention of the VP and director since the web tech manager was apparently doing crazy ML shit that they were not expecting me to do, it made them paranoid that I would eventually leave for a ML role somewhere, still here, but I want more moneys!!
A program that generates PDF documentation from user data, written in Go, Python and Perl (yes Perl) I even got shit from the lead developer since I used languages outside of their current scope of work. Dude had no option but to follow along with it :P since I am his boss
Many more. I am normally proud of my work code. But my biggest moment is my current ntural language processing unit that I am trying to code for my home, but I don't have enough power to build it with my computers, currently, my AI is too stupid, but sometimes it does reply back to my commands and does the things I ask it to do (simple things, opening a browser, search for a song etc) but 7 times out of ten it wont work :P -
You ever had a boss that made you feel like his bitch but he never really earned the title
You also know from a technical skill perspective you’re more competent.
And the only job he seems to do is micromanaging you. He just puts things under a microscope looking for a flaw. He always finds a flaw so in the off chance it breaks he’s always in the clear.
He’s the guy who sticks with the programs the he was taught when he was still at school and never really tried something new out of the box. He gives the reasons the he wasn’t formally trained in the other programs . I’m not talking cinema 4 here. I’m talking Matlab preference over python. Using lab-view as a production level development platform instead of going to something more approved by the industry.
He doesn’t take risk but he pushes those risks on you so if you fail he can say it wasn’t him
He’s never wrong but he’s never right either.
You’re sitting there doing the cunt work and breaking the sweat and he passes the achievements as under his management. You never really get the credit because “he guided you “. You go through hell fixing bugs and he disappears. He says he’s always a call away when what you really needed is someone taking the heavy tasks not throwing the entire project on your back.
I never call that piece of shit bcz he just throws some other bullshit that doesn’t make sense and emphasizes that might be the problem.
I once had a problem with the com port on a pc and was trying to figure out the problem. I asked him and he said that it might be bcz I’m connecting to the PC via VNC. I was like what the hell. What does that have to do with anything. I just ended up restarting the port and it bloody worked.
The saddest part is that I’m scared is that I might end up like him. In the same dead end job. Even though he guides me we work in a place where the job title doesn’t really change. Funny thing is that officially I have the same job title as him .
He’s been in the place for 5years when I came. Can someone imagine that? To work and work and then to be seized up with another brat who’s the same as you title wise.
You’re close the age of 40 and you work in a place where a 20 something year old walks in with the same Position as you.
I worry that I might end up the same if I stay long enough. That I’ll learn everything I can learn and just stop progressing and the only thing I can do is say how shit can break but wouldn’t know how to fix .
Pointing out problems because they are easier than fixing. Just plomonting into existential nihilism with no purpose.
I once told him I wanted to quit. He pretended he didn’t hear it. He then then said what do you see in this job in 5 years
I told him me not in it.
He said “seriously what do you want in this place “
I said “if I’m still her in 5 years I’ll be missing a toe because I would have shit myself in the foot”
I now realize that by convincing me to stay he might have convinced himself that staying for that long wasn’t a bad idea. He was looking for justification that he’s decision wasn’t that bad at all.
You give your life to a job and at the end it takes one away.
I don’t want to be like that and I think that’s what bugs me the most. That I’m so close to this individual that I feel sooner or later if I’m not careful I’ll end up in the same place. The same dread3 -
context: Python Sanic Backend, Bulma Frontend
*this is a direct repost of my rant on my discord*
UGH WHY IS EVERYTHING TOO COMPLICATED FOR NO FUCKING REASON
I JUST NEED AN INTERACTIVE UI WITHOUT EXPLICITLY DOING IT MYSELF WITH TONS OF BOILERPLATE CODE
React - uses JSX
Angular - uses TypeScript
what's next? some weird fucking thing that's not even necessary for basic needs
And why the fuck does react need node.js or some JSX compiler to make things easier?
None of this makes any fucking sense
Why not just declare actual javascript objects and functions and that's fuckin it
I just need regex validation and sometimes, custom validation based on other things
Then when the user changes something a small modal shows up asking to save changes
None of this bullshit
It's deadass simple
I don't need routing
No need for your JSX fuckery
No need for your TypeScript shit
I barely would even fucking use those
REEE
Fuck react, Fuck angular
React would've been the perfect thing for this shit
but NO
they had to make things 100x worse
Fucking bitch
because react has event hooks
I can just listen to the changes
then display the modal and get done with it
All other processing is done in the backend
IT'S THAT SIMPLE REACT
Validation is provided by the backend, Just fucking use regex in the frontend and that's it
IT JUST NEEDS TO DO SIMPLE THINGS
IT DOESN'T TAKE ROCKET SCIENCE TO DO MINIMAL WORK9