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 - "coding block"
-
This code review gave me eye cancer.
So, first of all, let me apologize to anyone impacted by eye cancer, if that really is a thing... because that sounds absolutely horrible. But, believe me, this code was absolutely horrible, too.
I was asked to code review another team's script. I don't like reviewing code from other teams, as I'm pretty "intense" and a nit-picker -- my own team knows and expects this, but I tend to really piss off other people who don't expect my level of input on "what I really think" about their code...
So, I get this script to review. It's over 200 lines of bash (so right away, it's fair game for a boilerplate "this should be re-written in python" or similar reply)... but I dive in to see what they sent.
My eyes.
My eyes.
MY EYES.
So, I certainly cannot violate IP rules and post any of the actual code here (be thankful - be very thankful), but let me just say, I think it may be the worst code I've ever seen. And I've been coding and code-reviewing for upwards of 30 years now. And I've seen a LOT of bad code...
I imagine the author of this script was a rebellious teenager who found the google shell scripting style guide and screamed "YOU'RE NOT MY REAL DAD!" at it and then set out to flagrantly violate every single rule and suggestion in the most dramatic ways possible.
Then they found every other style guide they could, and violated all THOSE rules, too. Just because they were there.
Within the same script... within the SAME CODE BLOCK... 2-space indentation... 4-space indentation... 8-space indentation... TAB indentation... and (just to be complete) NO indentation (entire blocks of code within another function of conditional block, all left-justified, no indentation at all).
lowercase variable/function names, UPPERCASE names, underscore_separated_names, CamelCase names, and every permutation of those as well.
Comments? Not a single one to be found, aside from a 4-line stanza at the top, containing a brief description of that the script did and (to their shame), the name of the author. There were, however, ENTIRE BLOCKS of code commented out.
[ In the examples below, I've replaced indentation spacing with '-', as I couldn't get devrant to format the indentation in a way to suitably share my pain otherwise... ]
Within just a few lines of one another, functions defined as...
function somefunction {
----stuff
}
Another_Function() {
------------stuff
}
There were conditionals blocks in various forms, indentation be damned...
if [ ... ]; then
--stuff
fi
if [ ... ]
--then
----some_stuff
fi
if [ ... ]
then
----something
something_else
--another_thing
fi
And brilliantly un-reachable code blocks, like:
if [ -z "$SOME_VAR" ]; then
--SOME_VAR="blah"
fi
if [ -z "$SOME_VAR" ]
----then
----SOME_VAR="foo"
fi
if [ -z "$SOME_VAR" ]
--then
--echo "SOME_VAR must be set"
fi
Do you remember the classic "demo" programs people used to distribute (like back in the 90s) -- where the program had no real purpose other than to demonstrate various graphics, just for the sake of demonstrating graphics techniques? Or some of those really bad photo slideshows, were the person making the slideshow used EVERY transition possible (slide, wipe, cross-fade, shapes, spins, on and on)? All just for the sake of "showing off" what they could do with the software? I honestly felt like I was looking at some kind of perverse shell-script demo, where the author was trying to use every possible style or obscure syntax possible, just to do it.
But this was PRODUCTION CODE.
There was absolutely no consistency, even within 1-2 adjacent lines. There is no way to maintain this. It's nearly impossible even understand what it's trying to do. It was just pure insanity. Lines and lines of insanity.
I picture the author of this code as some sort of hybrid hipster-artist-goth-mental-patient, chain-smoking clove cigarettes in their office, flinging their own poo at their monitor, frothing at the mouth and screaming "I CODE MY TRUTH! THIS CODE IS MY ART! IT WILL NOT CONFORM TO YOUR WORLDLY STANDARDS!"
I gave up after the first 100 lines.
Gave up.
I washed my eyes out with bleach.
Then I contacted my HR hotline to see if our medical insurance covers eye cancer.32 -
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 -
Tips for using a programming language that requires typing:
Don't.
Tips for using Scratch:
Do.
- Words from our IT teacher27 -
Coding Guide:
wanna start coding?
it's very simple, just follow this steps!
1. prepare a notebook and pen.
2. choose a programming language you would like to learn.
3. find a nice site for study it, SoloLearn is a very good site, you can ask me in the comments for more.
4. start copying every code block and summary to the notebook.
5. don't worry about not understanding it yet.
6. finish copying at last 5 subjects.
7. start the course again, and follow the notebook.
8. do it few times, your mind will remember it.
now the hard part!
good job, you remember the basic, but don't know how to use it? well 1 more guide for it.
1. prepare a notebook and pen.
2. now, it's your time to teaching it!
3. try to explain the code in your words or language.
4. after few times your mind will remember all the necessary things about coding.
5. start to make little apps or even games.
enjoy =D
of course you need to coding every day for 1 hour+-3 -
My code review nightmare part 2
Team responsible for code 'quality' dictated in their 18+ page coding standard document that all the references in the 'using' block be sorted alphabetically. Easy enough in Visual Studio with the right-click -> 'Remove and Sort Usings', so I thought.
Called into a conference room with other devs and the area manager (because 'Toby' needed an audience) focusing on my lack of code quality and not adhering to the coding standard.
The numerous files in question were unit tests files
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System.Collections.Generic;
using System.Linq;
<the rest of the usings>
T: "As you can see, none of these files' usings are in alphabetical order"
Me: "Um, I think they are. M comes before S"
T: "The standards clearly dictate system level references are to be sorted first."
Mgr: "Yes, why didn't you sort before checking this code in? T couldn't have made the standards any easier to follow. All you had to do is right-click and sort."
Me: "I did. M comes before S."
T: "No You Didn't! That is not a system reference!"
Me: "I disagree. MSTest references are considered a system level reference, but whatever, I'll move that one line if it upsets you that much."
Mgr: "OK smartass, that's enough disrespect. Just follow the fucking standard."
T: "And learn to sort. It's easy. You should have learned that in college"
<Mgr and T have a laugh>
Me: "Are all your unit tests up to standard? I mean, are the usings sorted correctly?"
T:"Um..well..of course they are!"
Me: "Lets take a look."
I had no idea, a sorted usings seems like a detail no one cares about that much and something people do when bored. I navigate to project I knew T was working on and found nearly all the file's usings weren't sorted. I pick on one..
using NUnit;
using Microsoft.Something.Other;
using System;
<the rest of the usings>
Me: "These aren't sorted..."
T: "Uh..um...hey...this file is sorted. N comes before M!"
Me: "Say that again. A little louder please."
Mgr: "NUnit is a system level nuget package. It's fine. We're not wasting time fixing some bug in how Visual Studio sorts"
Me: "Bug? What?..wait...and having me update 10 or so files isn't a waste of time?"
Mgr: "No! Coding standards are never a waste of time! We're done here. This meeting is to review your code and not T's. Fix your bugs and re-submit the code for review..today!"17 -
It was friday evening and almost everyone in office had left. I was assigned a bug related to some of my code changes. I called my senior to help me debug (has three years of experience, whereas me having only one year exp, who is also a very good friend of mine *always helps in debugging*).
So the code goes
switch (someEnum) {
case One:
doSomething()
// no break
case Two:
t.x = someEnum
break
case Three:
.....
}
I had recently added new enun One and was reciting the code logic to him as we were looking through code.
Him: Hey you haven't set t.x in case One. How did you miss that?
Me: No look, I haven't but a break on it. It will go ahead and set it in next case.
Him: What are you talking about? if the someEnun is One why would it execute Two case. Lets copy that line up there and try it locally.
Me: No no no wait. Are you saying that groovy doesn't need breaks in switch (Me being new to groovy but good with Java).
Him: Why would you need break in switch case even in Java?
Me: *stares at him*
Him: I'm going to execute a psvm right freaking now.
Me: *while he writes the psvm* Why did you think there were breaks in switch in any code?
Him: Shut up. *writes psvm code cursing me everywhere*
*executes code*
No way. Really??
Me: Tell me why do you think are there breaks in switch.
Him: I though they were to get you out of switch block and not execute the default block.
Me: So were you coding switch until now without breaks?
Him: I don't know man. I'm starting to doubt all the switches I have ever written.
Me: Anyway that's not the problem, so moving on.
*a while later*
Him: If a interviewer would ask me how would you rate yourself in Java. I would be like "Well I worked on various projects for 3 years in Java, but didnt know why we put breaks in switch. So you figure it out yourself."
One of the best moments in office.8 -
Worst hack/attack I had to deal with?
Worst, or funniest. A partnership with a Canadian company got turned upside down and our company decided to 'part ways' by simply not returning his phone calls/emails, etc. A big 'jerk move' IMO, but all I was responsible for was a web portal into our system (submitting orders, inventory, etc).
After the separation, I removed the login permissions, but the ex-partner system was set up to 'ping' our site for various updates and we were logging the failed login attempts, maybe 5 a day or so. Our network admin got tired of seeing that error in his logs and reached out to the VP (responsible for the 'break up') and requested he tell the partner their system is still trying to login and stop it. Couple of days later, we were getting random 300, 500, 1000 failed login attempts (causing automated emails to notify that there was a problem). The partner knew that we were likely getting alerted, and kept up the barage. When alerts get high enough, they are sent to the IT-VP, which gets a whole bunch of people involved.
VP-Marketing: "Why are you allowing them into our system?! Cut them off, NOW!"
Me: "I'm not letting them in, I'm stopping them, hence the login error."
VP-Marketing: "That jackass said he will keep trying to get into our system unless we pay him $10,000. Just turn those machines off!"
VP-IT : "We can't. They serve our other international partners."
<slams hand on table>
VP-Marketing: "I don't fucking believe this! How the fuck did you let this happen!?"
VP-IT: "Yes, you shouldn't have allowed the partner into our system to begin with. What are you going to do to fix this situation?"
Me: "Um, we've been testing for months already went live some time ago. I didn't know you defaulted on the contract until last week. 'Jake' is likely running a script. He'll get bored of doing that and in a couple of weeks, he'll stop. I say lets ignore him. This really a network problem, not a coding problem."
IT-MGR: "Now..now...lets not make excuses and point fingers. It's time to fix your code."
IT-VP: "I agree. We're not going to let anyone blackmail us. Make it happen."
So I figure out the partner's IP address, and hard-code the value in my service so it doesn't log the login failure (if IP = '10.50.etc and so on' major hack job). That worked for a couple of days, then (I suspect) the ISP re-assigned a new IP and the errors started up again.
After a few angry emails from the 'powers-that-be', our network admin stops by my desk.
D: "Dude, I'm sorry, I've been so busy. I just heard and I wished they had told me what was going on. I'm going to block his entire domain and send a request to the ISP to shut him down. This was my problem to fix, you should have never been involved."
After 'D' worked his mojo, the errors stopped.
Month later, 'D' gave me an update. He was still logging the traffic from the partner's system (the ISP wanted extensive logs to prove the customer was abusing their service) and like magic one day, it all stopped. ~2 weeks after the 'break up'.8 -
World class Korea's Scratch (yeah, the orange cat scratch) Test
You see the blocks, see the requirements, then DRAW the scratch blocks and do block coding IN PAPER.
WTFFFFFFFFF7 -
Awkward recruiting process? Sit the fuck back!
So about a year ago I got laid off. I got some help setting up LinkedIn and realising I'm not trash and offers to talk started flowing in.
So this consultancy firm asks me to come in for a talk and having nothing better to do I oblige - they're working on big, exciting Greenfield stuff and I'm amazed they want me.
Fast forward the most nervous week in my life and the HR assistant brings me into the meeting room, I get some water and a nice first impression - also my last. I wait in the room for five minutes.
In walks madam HR, madam Team lead and miss assistant from before, all carrying big ass laptops. We shake hands and they sit down and all open up their laptops between me and them - I just sit there feeling naked with my block of paper and pencil I brought.
So we wait for their machines to start up and madam HR just starts throwing questions at me and seemingly noting my answers into a sheet. Meanwhile madam Teamlead is busy on her phone most of the time and my most human interaction remains smalltalk and questions between me and miss assistant.
I did manage to get madam Teamlead to look up from her phone when I asked how they felt about the fact that I have no formal training and would need to pick up a lot of skills as we go, to which she said something along 'well this ain't a candy shop, we expect you to work' and looked back down at her phone.
A bit shaken, I agreed to stay for the technical test (apparently I passed the interview...)
Now this test was designed by their CTO since he didn't feel like any of the available tests on the market could properly judge applicants' skilllevels. Yes, alarms went off already at that point.
What I'm presented with is a word document with questions, and another for answers and... It's just string gymnastics and reference/value difference knowledge - shit it takes you a split second to look up or test if you ever get into these insane cases where you need to know. And then there was a likewise one with sql statements that was also just convoluted query gymnastics and trying to hide changes in the seemingly same statement through various questions. No questions on design, no problem solving, just... Attention span testing with a dash of coding?
Anyway, it turned out they had evening and weekend shifts and round the clock support tournus which on top of the ridiculous recruitment process and way lower than average salary offer had me turn them down.
Don't enable bullshit people, run away!4 -
Does music help you or does it distract you from coding?
It mostly distracts me, but sometimes helps me when I'm doing simple UI work etc. Or when I want to block normal people (even quietly) sitting or waddling around.10 -
Oh boy, this is gonna be good:
TL;DR: Digital bailiffs are vulnerable as fuck
So, apparently some debt has come back haunting me, it's a somewhat hefty clai and for the average employee this means a lot, it means a lot to me as well but currently things are looking better so i can pay it jsut like that. However, and this is where it's gonna get good:
The Bailiff sent their first contact by mail, on my company address instead of my personal one (its's important since the debt is on a personal record, not company's) but okay, whatever. So they send me a copy of their court appeal, claiming that "according to our data, you are debtor of this debt". with a URL to their portal with a USERNAME and a PASSWORD in cleartext to the message.
Okay, i thought we were passed sending creds in plaintext to people and use tokenized URL's for initiating a login (siilar to email verification links) but okay! Let's pretend we're a dumbfuck average joe sweating already from the bailiff claims and sweating already by attempting to use the computer for something useful instead of just social media junk, vidya and porn.
So i click on the link (of course with noscript and network graph enabled and general security precautions) and UHOH, already a first red flag: The link redirects to a plain http site with NOT username and password: But other fields called OGM and dossiernumer AND it requires you to fill in your age???
Filling in the received username and password obviously does not work and when inspecting the page... oh boy!
This is a clusterfuck of javascript files that do horrible things, i'm no expert in frontend but nothing from the homebrewn stuff i inspect seems to be proper coding... Okay... Anyways, we keep pretending we're dumbasses and let's move on.
I ask for the seemingly "new" credentials and i receive new credentials again, no tokenized URL. okay.
Now Once i log in i get a horrible looking screen still made in the 90's or early 2000's which just contains: the claimaint, a pie chart in big red for amount unpaid, a box which allows you to write an - i suspect unsanitized - text block input field and... NO DATA! The bailiff STILL cannot show what the documents are as evidence for the claim!
Now we stop being the pretending dumbassery and inspect what's going on: A 'customer portal' that does not redirect to a secure webpage, credentials in plaintext and not even working, and the portal seems to have various calls to various domains i hardly seem to think they can be associated with bailiff operations, but more marketing and such... The portal does not show any of the - required by law - data supporting the claim, and it contains nothing in the user interface showing as such.
The portal is being developed by some company claiming to be "specialized in bailiff software" and oh boy oh boy..they're fucked because...
The GDPR requirements.. .they comply to none of them. And there is no way to request support nor to file a complaint nor to request access to the actual data. No DPO, no dedicated email addresses, nothing.
But this is really the ham: The amount on their portal as claimed debt is completely different from the one they came for today, for the sae benefactor! In Belgium, this is considered illegal and is reason enough to completely make the claim void. the siple reason is that it's unjust for the debtor to assess which amount he has to pay, and obviously bailiffs want to make the people pay the highest amount.
So, i sent the bailiff a business proposal to hire me as an expert to tackle these issues and even sent him a commercial bonus of a reduction of my consultancy fees with the amount of the bailiff claim! Not being sneery or angry, but a polite constructive proposal (which will be entirely to my benefit)
So, basically what i want to say is, when life gives you lemons, use your brain and start making lemonade, and with the rest create fertilizer and whatnot and sent it to the lemonthrower, and make him drink it and tell to you it was "yummy yummy i got my own lemons in my tummy"
So, instead of ranting and being angry and such... i simply sent an email to the bailiff, pointing out various issues (the ones6 -
So, finally I can rant after a while.
After I stopped helping people coding online few months ago, because I was getting literally spammed 24/7 by everyones shitty multi-million dollar ideas, I introduced few of my classmates in to coding. Now, after ~6 months, I am spammed by my classmates by their awesome programming ideas which are too hard for them but they are sure its gonna be awesome. The difference is, that I cant say "FUCK OFF AND STOP SPAMMING MY INBOX WITH YOUR FUCKING IDEAS" to my friends and block them. Please fucking kill me. Once more someone will start messaging me their fucking idea
-like this
-in
-separate
-messages instead
-of writing one
-long and propper
-message
I am gonna swim with a toaster. 😡3 -
During my job hunt as a Java Developer looking for job while on a job just like what every other developers do, around twenty twelve i got an invite from one of the companies i applied for, i wasn't expecting a test though but i was prepared for it anyway. The test proceeds, i and the other partakers were given separate systems and spread out across the room like teams in a football match, i don't know if they planned on making us nervous, it seemed so very awkward. First question was *Who originally developed Java (like seriously???? i almost cummed!) i skipped... skip skip skip. After so many skipping minutes i then arrived at that question ***Check string for palindrome, hmmm i then noticed my system was connected to an open wifi (don't know if it was a dumb mistake or on purpose). I definitely googled and faithful loving heavens i found the website were they got all 21 questions with their answers from (https://simpleprogrammer.com/progra...). I answered all questions using different approach, applied xml commenting, state possibility and outcome of each code block, added wiki references, i flawed the test. Few days later i received a call for final interview, got there and the interviewer was like "Do you teach/lecture on coding or something? cus you really did pretty good on the test the other day", I felt like a god and was like "no, i don't. just did what i had to do". Seems like he loved my reply and i got the job without a second question. The open network is still a mystery to me till date.6
-
!rant
Anyone else who can't focus while listening to music? I can't grasp how that's not annoying to people.
The sound of silence.
For real, the best coding flows happen then.
If there is something that I can hear and process, my train of thought behaves like a dream behaves when you wake up in the morning.
Even worse are children, humming, whistling or munching as the ONLY sound in that silence, Im scorching inside when that happens.
If I can't be somewhere silent (preferably completely), I block the distractions with binaural beats and/or sound of rain.26 -
It’s very annoying that at my school we barely get any coding at all and to top it off it’s in a typing class using block coding. Considering it’s in a TYPING class you’d think they’d’ve used their typing skills to use but no, they instead use block coding meant for like 4th graders. This is why I say we need more coding classes in schools. Not only that but make it more mainstream1
-
Have some downtime today, so since I lucked out and found some old backups (from before I used Git) of a project I was planning on revisiting, I decided to fire it up and see what I can do to get that going again.
And discovering just how much my coding style has changed since then...
[Code is in PHP, for reference]
* Virtually no documentation (whereas my current style is near-obsessive with PHPdoc blocks)
* Where comments exist, they only use // and are a full tab after the end of the line
* All assignment operators are dutifully aligned on tabs
* Have to update the entire codebase because it relies on deprecated `mysql_*` calls
* Have to flip all of the quotes throughout the codebase because I used double-quotes as my primary at the time instead of single quotes.
* Also relied on magic quotes for injecting variable content into strings
* Associative array practices varied; sometimes the names are encased in double quotes, but I just hit a block where it's all leaving it to the compiler to interpret unquoted string literals
And perhaps the most egregious so far...
* Any time we get database results back the process for cycling through them is to do `$count = mysql_num_rows($result);` (or $count2, etc.), then do a `for ($i = 0; $i < $count; $i++)` (again, or $j, $k, etc.), instead of just a simple `while ($data = $result->fetch_assoc())`2 -
To me this is one of the most interesting topics. I always dream about creating the perfect programming class (not aimed at absolute beginners though, in the end there should be some usable software artifact), because I had to teach myself at least half of the skills I need everyday.
The goal of the class, which has at least to be a semester long, is to be able to create industry-ready software projects with a distributed architecture (i.e. client-server).
The important thing is to have a central theme over the whole class. Which means you should go through the software lifecycle at least once.
Let's say the class consists of 10 Units à ~3 hours (with breaks ofc) and takes place once a week, because that is the absolute minimum time to enable the students to do their homework.
1. Project setup, explanation of the whole toolchain. Init repositories, create SSH keys for github/bitbucket, git crash course (provide a cheat sheet).
Create a hello world web app with $framework. Run the web server, let the students poke around with it. Let them push their projects to their repositories.
The remainder of the lesson is for Q&A, technical problems and so on.
Homework: Read the docs of $framework. Do some commits, just alter the HTML & CSS a bit, give them your personal touch.
For the homework, provide a $chat channel/forum/mailing list or whatever for questions where not only the the teacher should help, but also the students help each other.
2. Setup of CI/Build automation. This is one of the hardest parts for the teacher/uni because the university must provide the necessary hardware for it, which costs money. But the students faces when they see that a push to master automatically triggers a build and deploys it to the right place where they can reach it from the web is priceless.
This is one recurring point over the whole course, as there will be more software artifacts beside the web app, which need to be added to the build process. I do not want to go deeper here, whether you use Jenkins, or Travis or whatev and Ansible or Puppet or whatev for automation. You probably have some docker container set up for this, because this is a very tedious task for initial setup, probably way out of proportion. But in the end there needs to be a running web service for every student which they can reach over a personal URL. Depending on the students interest on the topic it may be also better to setup this already before the first class starts and only introduce them to all the concepts in a theory block and do some more coding in the second half.
Homework: Use $framework to extend your web app. Make it a bit more user interactive with buttons, forms or the like. As we still have no backend here, you can output to alert or something.
3. Create a minimal backend with $backendFramework. Only to have something which speaks with the frontend so you can create API calls going back and forth. Also create a DB, relational or not. Discuss DB schema/model and answer student questions.
Homework: Create a form which gets transformed into JSON and sent to the backend, backend stores the user information in the DB and should also provide a query to view the entry.
4. Introduce mobile apps. As it would probably too much to introduce them both to iOS and Android, something like React Native (or whatever the most popular platform-agnostic framework is then) may come in handy. Do the same as with the minimal web app and add the build artifacts to CI. Also talk about getting software to the app/play store (a common question) and signing apps.
Homework: Use the view API call from the backend to show the data on the mobile. Play around with the mobile project to display it in a nice way.
5. Introduction to refactoring (yes, really), if we are really talking about JS here, mention things like typescript, flow, elm, reason and everything with types which compiles to JS. Types make it so much easier to refactor growing codebases and imho everybody should use it.
Flowtype would make it probably easier to get gradually introduced in the already existing codebase (and it plays nice with react native) but I want to be abstract here, so that is just a suggestion (and 100% typed languages such as ELM or Reason have so much nicer errors).
Also discuss other helpful tools like linters, formatters.
Homework: Introduce types to all your API calls and some important functions.
6. Introduction to (unit) tests. Similar as above.
Homework: Write a unit test for your form.
(TBC)4 -
for the life of me I cannot figure out in my mind how to structure this project I want to start, and jumping right into coding does not improve this mental block.
At work this Golang code base has a clean architecture, so easy to maintain and extend, and I'm unable to replicate it on my own project(s). It sucks to be an ignorant.2 -
From today, I'm gonna post infrequent-devLogs of the project i am currently doing, I have been thinking about it the past couple of months, and I am finally moving it into action!
I wish writing devLogs will make me to finish the project, at least a working prototype.
It is a C# block coding application that is made in 100% C# that generates human-readable C# code for C# begineers.
If you want to follow me along, make sure to subscribe to my rants by going to my Profile (cozyplanes) > More icon in top right > Subscribe
All devLogs posted directly via devRant API integration from CZedit, a simple edit program for geeks
=========================
devLog #0 - Block coding in C#
Done:
- Made the console output to redirect to textbox
- Ability to save output to external storage
WIP:
Compile C# code directly at runtime with Roslyn
Notes:
open-source??5 -
Quick question, because I have no idea how to Google it. The "block coding" concept that scratch is built upon, does anyone know if it's copyrighted in any way?
Working on a project, where I'm thinking of implementing something like it.5 -
If you enjoy coding at coffee shops, remember to wear headphones. Not only will it help you focus, it'll also block out John Mayer.1
-
How the fuck can people acutally work with freaking windows?!
I use a dual boot with ubuntu and windows, the only reason why there is a small piece of windows is because i like to play games some time, and the freaking developers who are coding them are afraid of windows or whatever ...
Anyway, i wanted to try something with windows and app virtualization which required me to use windows. Holy shit everything is so freaking complicated if you want to do it not with a gui. Need some admin rights, ... no dont use the terminal you need to right click 'run as admin' and shit. I mean wtf?!
How can people who have a freaking idea of what they are doing using windows?!
Every f*cking minute with that shitty os feels like a hour. 2 blue screens so far, and it seems m$ decided to download some updates that freaking block my work and getting my pc to lag ... what a piece of sh*t!21 -
Shit... watched too many videos about AI. Now I'm convinced human coding will be obsolete in the near future...
Hello code block, long time no see...1 -
So i bribed a fellow dev/friend who HATES php and Magento... to help me grind out a Magento site while im super behind on a bunch of crap that's mostly boring administrative bs (#ReluctantlyInCharge)
He knew I was coding in python several times over the past several months... yet, despite my near constant griping of formatting bs and high preference of basically anything that doesnt require readability-esq formatting... he apparently didnt get it.
I need to make a quick splash page with a timer on it (other cool elements that i dont think ive ever seen done but i figured why not... weird shit is totally on brand here... like scripting page elements to change and see if people catch on... in very basic ways)...
I know js plenty... but I'd likely have looked up the syntax, was lazy, he loves js (for the intended purpose... he does a lot of blockchain dev) so i asked if hed write me a quick timer line cuz... well im lazy.
He totally overcomplicated it and sends me a page he typed up incl html header. Timer was 3 short block/lines with semicolons... i laughed and wondered why he did all that instead of just the little js... he didnt know either. I told him as a courtesy id make sure to keep the js formatting as he wrote it instead of 1 line...
He sends me 2 examples of a js timer in 1 line... like 1semicolon... i had to show him what i actually meant... 3 'lines' with semicolons on 1 visual line...
He was stunned, then realised i must really hate python11 -
Guys so there's thia company called Whitehat jr, who's doing a lot of shady stuff. They pretend to teach kids coding by making them dabble with scratch/block type editor and charge them upto 100000 rupees for the course. Their teachers also dont know coding!!! I feel very bad for the kids who are forced by their parents into all this crap without doing prior research..11
-
What’s your guys thoughts on people calling Scratch and other block coding programs coding and calling themselves coders or programmers for just knowing scratch.7
-
Top 12 C# Programming Tips & Tricks
Programming can be described as the process which leads a computing problem from its original formulation, to an executable computer program. This process involves activities such as developing understanding, analysis, generating algorithms, verification of essentials of algorithms - including their accuracy and resources utilization - and coding of algorithms in the proposed programming language. The source code can be written in one or more programming languages. The purpose of programming is to find a series of instructions that can automate solving of specific problems, or performing a particular task. Programming needs competence in various subjects including formal logic, understanding the application, and specialized algorithms.
1. Write Unit Test for Non-Public Methods
Many developers do not write unit test methods for non-public assemblies. This is because they are invisible to the test project. C# enables one to enhance visibility between the assembly internals and other assemblies. The trick is to include //Make the internals visible to the test assembly [assembly: InternalsVisibleTo("MyTestAssembly")] in the AssemblyInfo.cs file.
2. Tuples
Many developers build a POCO class in order to return multiple values from a method. Tuples are initiated in .NET Framework 4.0.
3. Do not bother with Temporary Collections, Use Yield instead
A temporary list that holds salvaged and returned items may be created when developers want to pick items from a collection.
In order to prevent the temporary collection from being used, developers can use yield. Yield gives out results according to the result set enumeration.
Developers also have the option of using LINQ.
4. Making a retirement announcement
Developers who own re-distributable components and probably want to detract a method in the near future, can embellish it with the outdated feature to connect it with the clients
[Obsolete("This method will be deprecated soon. You could use XYZ alternatively.")]
Upon compilation, a client gets a warning upon with the message. To fail a client build that is using the detracted method, pass the additional Boolean parameter as True.
[Obsolete("This method is deprecated. You could use XYZ alternatively.", true)]
5. Deferred Execution While Writing LINQ Queries
When a LINQ query is written in .NET, it can only perform the query when the LINQ result is approached. The occurrence of LINQ is known as deferred execution. Developers should understand that in every result set approach, the query gets executed over and over. In order to prevent a repetition of the execution, change the LINQ result to List after execution. Below is an example
public void MyComponentLegacyMethod(List<int> masterCollection)
6. Explicit keyword conversions for business entities
Utilize the explicit keyword to describe the alteration of one business entity to another. The alteration method is conjured once the alteration is applied in code
7. Absorbing the Exact Stack Trace
In the catch block of a C# program, if an exception is thrown as shown below and probably a fault has occurred in the method ConnectDatabase, the thrown exception stack trace only indicates the fault has happened in the method RunDataOperation
8. Enum Flags Attribute
Using flags attribute to decorate the enum in C# enables it as bit fields. This enables developers to collect the enum values. One can use the following C# code.
he output for this code will be “BlackMamba, CottonMouth, Wiper”. When the flags attribute is removed, the output will remain 14.
9. Implementing the Base Type for a Generic Type
When developers want to enforce the generic type provided in a generic class such that it will be able to inherit from a particular interface
10. Using Property as IEnumerable doesn’t make it Read-only
When an IEnumerable property gets exposed in a created class
This code modifies the list and gives it a new name. In order to avoid this, add AsReadOnly as opposed to AsEnumerable.
11. Data Type Conversion
More often than not, developers have to alter data types for different reasons. For example, converting a set value decimal variable to an int or Integer
Source: https://freelancer.com/community/...2 -
I have a coding block. I blame school. I'm on break for 2 weeks. The first week just finished. I try to work on my personal projects and I just lose interest. I have the motivation and stuff but when I try to work on them, the feeling just goes away.
-
Clean code is the biggest bullshit in software development history. Oris it agile/scrum? Can’t decide yet.
Note: A new contender arrives with anti-nested coding cult. You hide your deep nested logic away from main logic block, so it is easier to maintain… Said probably by someone who never coded serious software.4 -
hi guys so i'll be having a tutorial session tomorrow about java programming(not my choice) and im looking for scratch(like) game or any block programming games that can have classes with methods and properties. btw i want to use block type programming first before getting into hard coding because (at least i think) it can help ease the learning curve, it will help understanding about the concepts first without the pressure of remembering syntax. any recommendations?1
-
Anytime I write a line of code that works correctly the first time, I’m ecstatic. If I write a whole block or function that works right the first time, I freak out with happiness. Yes, I’m that bad at coding. The rest of y’all probably do such things on the regular and it no biggie. But for me, it’s vanishingly rare.
-
Did someone already thought about how color highlight can be better? It's been 4-5 years now that I'm coding on a virtual console that run on iPad with a monochrome code editor. Despite the fact that's remind me the old days when I was 8 years old, that doesn't stop me for coding with it.
I mean, is it really important to know that strings are red and numbers are yellow? How does that help me? They are both literal and behave to the user-content categories.
I was talking with my friend, and he says he likes to know if something is a keyword or an identifier. In C++, a lot of common keywords to define stuff and control the flow are often the first word and easy to spot.
A couple of months ago, I tried Flutter, and the editor can highlight ident blocks and give them different colors, but with Flutter, it's easy to get 10 or more ident levels, Does the color help? Splitting the code does.
I think, there is so much stuff that is more important than coloring the grammar of a language. For instance: knowing if an identifier belongs to which Rust Crate because, It's easy to stack 10 or more dependencies in one file that as better chances of names collisions.
Knowing if an identifier was recognized, if it used, if it's a local, a member, a global, a compiled value or a macro seems more important.
I would like to color block of code that is important or sensible. That will help my coworker about the severity of a particular place in the code.
What do you think?1 -
Workflow? More like chasing answer from a community that is not, and never has been, famous for its pedagogical skills. So hand me some coffee, weed and/or some snacks because I'll still search high and low, skip sleep and build up a few hundred pages browsing history so that in the end, I'll reach the understanding I'm looking for anyways. Even if whatever person trying to help me - in their delusion that I already know everything, except for that thing I'm asking about of course - really, REALLY just failed at saying "that goes there because of that" instead of "did you try insertSomeAppropriateRandomNameOfAThingYouAssumeEveryoneKnowsHere..?".
But who am I kidding? The tools are better than ever (IDE'S). The pedagogical skills are getting its own arenas to build on and its coming along greatly (coding block apps, treehouse and the likes etc. etc).
And no matter the struggle, I can't escape that I love coding and learning more than anything else.
Now how do I.. Where.. When.. Why the.. -
So I'm a 4th year computer science student, and my school has mandatory Co-Op requirements, of which I need to complete an internship for 3 semesters. I have already completed 2 semesters at a tech company, and have continued to work part time for them for the past year. Though, for my last co-op block I wanted to try to go for a bigger more well known company that would look good on my resume after graduation. For several reasons, I was looking for something in the Boston area and I came across two companies that seemed like great places to work at, so I began preparing.
For both companies, the process was very similar: I applied, got a phone interview, completed a coding assignment, made it to the final technical interview. For both technical interviews, I did some research and found the typical prompts that these companies ask. I took a look at both of them and they both involved a relatively simple challenge that involved string manipulation in the language of your choice. Before both interviews I practiced these challenges to make sure I could do them, it was no problem, could do each of them my first try in about 15 minutes. However, when it came to sitting down with their engineers, it was totally different.
Even though I literally practiced the problem before hand, I for some reason kept blanking on things during both interviews. For some reason I was finding it extremely challenging to talk and code at the same time. The first company interview went very well except for the coding portion in which they gave me feedback saying "I didn't seem confident in my coding skills", which is why I didn't get that position. For the second interview I couldn't even finish the assignment in the full hour even though I practiced it beforehand and did it in 15 minutes on my own. It is very frustrating because I feel that out of all the aspects involved in an interview, coding is in reality my strongest, but it just seems completely different when I have to explain what I'm doing while I'm doing it.
Has anyone else experienced this sort of thing? If so, how did you get past it/prepare for it?1 -
Too early in the year for goals so far, but I'll give it a shot. Here's what I'm gunning for in the short-term:
Week 85 - 2018 Dev/Coding Goals:
- Continue educating myself in the Rust programming language (I feel like I dropped the ball there last year, Rust is easy to get programmer's block because it's syntax isn't always clear what should be done with it and/or why, the references. Ugghh fml).
- Get feature parity of PYXReloaded with it's predecessor, and get most of the planned features implemented. Friends of mine really want this and like screencaps I've sent already. It's a project I've been working on with @Gianlu for the past few days.
Week 85 - 2018 General/Personal Goals:
- Get over my motivational issues.
- Get over my depression/loneliness
- Get over my social anxiety.
I'm trying to better myself, both in coding and personal life. I fucking love this community. I used to use Reddit to find posts exactly like the ones here, but this is wayyy better and has everything all in one place.
Have a prosperous 2018, guys. Remember not to look at what you want to get done in just 365 days. You need to see the big picture. -
There are five goofus mfs in my head that tell me terrible, silly solutions, and there's only 1 that is like "yeah maybe you should do that but I'm too lazy to think about it sorry 💁♂️". And then when I get to coding I'll have to delete like a whole block bc the other guys lead me off my pre-drawn plan wtf.
-
Does a role reassignment necessarily mean I am on the chopping block/going to be laid off? I was hired as a Junior Software Architect and I ended up doing more infrastructure work (think DevOps) but I wanted to do more actual C++ coding. An email was sent out to the manager/HR by my supervisor and I think for the most part I will still retain the same title - the email just states what my next tasks are (knowledge transfer to other employees) and what my new role will be.