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 - "optimisation"
-
Spent 2 days carefully crafting a highly optimised routine, then spent 3 minutes to write an unoptimised version for benchmarking. The latter ran 50% faster.4
-
Ah, C++. Where the compiler optimisation is fucking you so hard that you don't need a girlfriend anymore 😒10
-
So you build a beautiful site; you spend good time on UX, refactoring, server optimisation, getting good page load speeds, SQL all optimised - life is good.
Commercial team comes in and slaps clickbait, generic advertising, tracking scrips over the lot.
Page loads go from a second to 30 seconds and even though you made sure all those crappy ad scripts are asynchronous pages still hang most times. PingdomTools lists your page scripts as going from 40 files to over 900... now users are ringing me up giving me grief about how slow this new company website is...5 -
Fun/Interesting fact:
"++i" can be slightly faster than "i++"
Because "i++" can require a local copy of the value of "i" before it gets incremented, while "++i" never does. In some cases, some compilers will optimize it away if possible... but it's not always possible, and not all compilers do this.15 -
No... No... No!
The game engine is not in charge of code optimisation, if your program runs like ass; it is 99% going to be your fault...
Sick of seeing people judge engines because of the poorly optimised things made in them by half assed developers... Why do the good things never get any attention where the shit gets all of it... Why?!
(Just had someone crack the shits at me because I'm not using a 'real' engine and am not a a 'real' developer because I'm not using unreal... So I'm in a fan-fucking-tastic mood after that :-D)2 -
1. Decide to learn optimisation algorithms
2. Realise that you have forgotten calculus
3. Decide to learn from the beginning
4. Search for tutorials
5. Go through the introduction parts
6. You know that you can't complete
7. You watch other entertainment things on YouTube.
Stories of a lazy programmer...11 -
5 years ago i was working on a 2D game using C and we needed to use the sleep function (I forgot why ) .but however one of my team member did something new , for each second he did an empty for loop from 0 to 1000000 .You never know maybe that's how it's implemented (sarcasm)1
-
Website WITH FB, Twitter, translate plugin:
Page size: 3.6MB
Requests: 97
Website WITHOUT FB, Twitter, translate plugin:
Page size: 680KB
Requests: 21
Wth!! And can't find a way to optimise these shits..3 -
Want to make someone's life a misery? Here's how.
Don't base your tech stack on any prior knowledge or what's relevant to the problem.
Instead design it around all the latest trends and badges you want to put on your resume because they're frequent key words on job postings.
Once your data goes in, you'll never get it out again. At best you'll be teased with little crumbs of data but never the whole.
I know, here's a genius idea, instead of putting data into a normal data base then using a cache, lets put it all into the cache and by the way it's a volatile cache.
Here's an idea. For something as simple as a single log lets make it use a queue that goes into a queue that goes into another queue that goes into another queue all of which are black boxes. No rhyme of reason, queues are all the rage.
Have you tried: Lets use a new fangled tangle, trust me it's safe, INSERT BIG NAME HERE uses it.
Finally it all gets flushed down into this subterranean cunt of a sewerage system and good luck getting it all out again. It's like hell except it's all shitty instead of all fiery.
All I want is to export one table, a simple log table with a few GB to CSV or heck whatever generic format it supports, that's it.
So I run the export table to file command and off it goes only less than a minute later for timeout commands to start piling up until it aborts. WTF. So then I set the most obvious timeout setting in the client, no change, then another timeout setting on the client, no change, then i try to put it in the client configuration file, no change, then I set the timeout on the export query, no change, then finally I bump the timeouts in the server config, no change, then I find someone has downloaded it from both tucows and apt, but they're using the tucows version so its real config is in /dev/database.xml (don't even ask). I increase that from seconds to a minute, it's still timing out after a minute.
In the end I have to make my own and this involves working out how to parse non-standard binary formatted data structures. It's the umpteenth time I have had to do this.
These aren't some no name solutions and it really terrifies me. All this is doing is taking some access logs, store them in one place then index by timestamp. These things are all meant to be blazing fast but grep is often faster. How the hell is such a trivial thing turned into a series of one nightmare after another? Things that should take a few minutes take days of screwing around. I don't have access logs any more because I can't access them anymore.
The terror of this isn't that it's so awful, it's that all the little kiddies doing all this jazz for the first time and using all these shit wipe buzzword driven approaches have no fucking clue it's not meant to be this difficult. I'm replacing entire tens of thousands to million line enterprise systems with a few hundred lines of code that's faster, more reliable and better in virtually every measurable way time and time again.
This is constant. It's not one offender, it's not one project, it's not one company, it's not one developer, it's the industry standard. It's all over open source software and all over dev shops. Everything is exponentially becoming more bloated and difficult than it needs to be. I'm seeing people pull up a hundred cloud instances for things that'll be happy at home with a few minutes to a week's optimisation efforts. Queries that are N*N and only take a few minutes to turn to LOG(N) but instead people renting out a fucking off huge ass SQL cluster instead that not only costs gobs of money but takes a ton of time maintaining and configuring which isn't going to be done right either.
I think most people are bullshitting when they say they have impostor syndrome but when the trend in technology is to make every fucking little trivial thing a thousand times more complex than it has to be I can see how they'd feel that way. There's so bloody much you need to do that you don't need to do these days that you either can't get anything done right or the smallest thing takes an age.
I have no idea why some people put up with some of these appliances. If you bought a dish washer that made washing dishes even harder than it was before you'd return it to the store.
Every time I see the terms enterprise, fast, big data, scalable, cloud or anything of the like I bang my head on the table. One of these days I'm going to lose my fucking tits.10 -
What a difference three lines of code can make. That's the typical case of "that seemed to be a good idea". I don't know how did I think it would work out on the long run. Next step will be reduceing the enourmous CPU usage as well.3
-
Lessons I've learnt so far on programming
-- Your best written code today can be your worst tomorrow (Focus more on optimisation than style).
-- Having zero knowledge of a language then watching video tutorials is like purchasing an arsenal before knowing what a gun is (Read the docs instead).
-- It's works on my machine! Yes, because you built on Lenovo G-force but never considered the testers running on Intel Pentium 0.001 (Always consider low end devices).
-- "Programming" is you telling a story and without adding "comments" you just wrote a whole novel having no punctuation marks (Always add comments, you will thank yourself later for it I promise).
-- In programming there is nothing like "done"! You only have "in progress" or "abandoned" (Deploy progressively).
-- If at this point you still don't know how to make an asynchronous call in your favourite language, then you are still a rookie! take that from me. (Asynchronous operation is a key feature in programming that every coder should know).
-- If it's more than two conditions use "Switch... case" else stick with "If... else" (Readability should never be under-rated).
-- Code editors can MAKE YOU and BREAK YOU. They have great impact on your coding style and delivery time (Choose editors wisely).
-- Always resist the temptation of writing the whole project from scratch unless needs be (Favor patching to re-creation).
-- Helper methods reduces code redundancy by a large chunk (Always have a class in your project with helper methods).
-- There is something called git (Always make backups).
-- If you don't feel the soothing joy that comes in fixing a bug then "programming" is a no-no (Coding is fun only when it works).
-- Get angry with the bugs not the testers they're only noble messengers (Bugs are your true enemy).
-- You would learn more than a lot reading the codes of others and I mean a lot! (Code review promotes optimisation and let's you know when you are writing macaroni).
-- If you can do it without a framework you have yourself a big fat plus (Frameworks make you entirely dependent).
-- Treat your code like your pet, stop taking care of it and it dies! (Codes are fragile and needs regular updates to stay relevant).
Programming is nothing but fun and I've learnt that a long time ago.6 -
I felt like being the cause for “that dreaded legacy code“ and wrote 250 lines of C preprocessor macros for generating bitfields in a large header file automatically, with the goal of simplifying and clarifying register access for all peripherals in the end. Then, I found out that SDCC's optimisation for bitfields is absolutely awful (if existent at all), and I don't really want to use these abstractions if they have a performance impact.
Did I deserve that?7 -
Is your code green?
I've been thinking a lot about this for the past year. There was recently an article on this on slashdot.
I like optimising things to a reasonable degree and avoid bloat. What are some signs of code that isn't green?
* Use of technology that says its fast without real expert review and measurement. Lots of tech out their claims to be fast but actually isn't or is doing so by saturation resources while being inefficient.
* It uses caching. Many might find that counter intuitive. In technology it is surprisingly common to see people scale or cache rather than directly fixing the thing that's watt expensive which is compounded when the cache has weak coverage.
* It uses scaling. Originally scaling was a last resort. The reason is simple, it introduces excessive complexity. Today it's common to see people scale things rather than make them efficient. You end up needing ten instances when a bit of skill could bring you down to one which could scale as well but likely wont need to.
* It uses a non-trivial framework. Frameworks are rarely fast. Most will fall in the range of ten to a thousand times slower in terms of CPU usage. Memory bloat may also force the need for more instances. Frameworks written on already slow high level languages may be especially bad.
* Lacks optimisations for obvious bottlenecks.
* It runs slowly.
* It lacks even basic resource usage measurement.
Unfortunately smells are not enough on their own but are a start. Real measurement and expert review is always the only way to get an idea of if your code is reasonably green.
I find it not uncommon to see things require tens to hundreds to thousands of resources than needed if not more.
In terms of cycles that can be the difference between needing a single core and a thousand cores.
This is common in the industry but it's not because people didn't write everything in assembly. It's usually leaning toward the extreme opposite.
Optimisations are often easy and don't require writing code in binary. In fact the resulting code is often simpler. Excess complexity and inefficient code tend to go hand in hand. Sometimes a code cleaning service is all you need to enhance your green.
I once rewrote a data parsing library that had to parse a hundred MB and was a performance hotspot into C from an interpreted language. I measured it and the results were good. It had been optimised as much as possible in the interpreted version but way still 50 times faster minimum in C.
I recently stumbled upon someone's attempt to do the same and I was able to optimise the interpreted version in five minutes to be twice as fast as the C++ version.
I see opportunity to optimise everywhere in software. A billion KG CO2 could be saved easy if a few green code shops popped up. It's also often a net win. Faster software, lower costs, lower management burden... I'm thinking of starting a consultancy.
The problem is after witnessing the likes of Greta Thunberg then if that's what the next generation has in store then as far as I'm concerned the world can fucking burn and her generation along with it.6 -
As I already said on devrant, I'm a freelance web developer and I also often sell my services for teaching, loving that. Currently I'm teaching PHP with 30 students and it's going very well.
But yesterday, I received an offer for giving another course next month, this time on HTML and CSS, for a company I don't know yet. Almost every line of this email is wrong, outdated by 20 years, or just basically meaningless...
So I thought I could do my best to translate this as close as possible to the original, preserving the wrong formulations too, just for you devranters fellas.
"Hello,
I have an offer for a 2 days course for 5 people (level 1+ and/or 2), on HTML5 and CSS3. Below, the program :
1. XHTML AND CSS2 INTRODUCTION
Advantages and benefits of change
Understanding compatibility for different versions of browsers
HTML, XHTML, CSS edition tools : presentation of the different tools
The CSS language : different types of selectors : class of selector, identifier of selector, contextual selectors, grouped selectors
Blocks of text, boxes of text
The CSS1, CSSP, CSS2 properties
Relative and absolute measures units
2. LAYOUT TECHNIQUES
Full CSS, XHTML websites demo
Positioning with the position property, positioning with the float property
Columns creation
Layout for forms
Layout for data tables
Layout for menus
3. INTRODUCTION TO SVG (SCALABLE VECTOR GRAPHICS)
Role and importance of SVG
Using SVG on client side : basic shapes
SVG structure of document, tags examples
Using CSS styles with SVG
Different integration methods for SVG in a XHTML document
4. OPTIMISATION OF JAVASCRIPT CODE
Introduction to DOM and Javascript
Access to document objects : different access techniques, using this keyword, create elements dynamically
Positioning elements with the help of Javascript : positionning elements relatively to the mouse, move elements
Show/hide elements for creating hierarchical menus
Code optimisation techniques : using objects, objects litterals, loops optimisation
Can you please give me your availability ?"
Seriously...
CSS-fucking-1 ! Is it a course for dinosaurs ?
...And if only my rant was just about the program...
It's totally impossible to cover all these subjects in only 2 days with people of different levels and experience.
The guy exactly said to me : "don't worry about the program, it's an old text but they agreed to it anyway. They just want to learn HTML and CSS, some of them already know it but want to learn more, and the others are total beginers.".
And here is the meaning for the "(level 1+ and/or 2)" part in the email.
So... Surprizingly, I accepted the offer, but asked for at least a 3rd day. I'm waiting for their answer, but I'll do it anyway, adapting the course content to the actual students knowledge. I need the money, after all.
Wish me luck...
It's just sad that these formation companies are selling bullshit to clients that just want to learn something useful. It's too often like that, they sell shitty/useless programs and we have to catch up in real time with students that don't understand why they don't learn what was told to them.3 -
Just had an argument with someone who thinks (micro)python is the way to go for embedded projects. Cause a lot of engineers are terrible at using C/C++. And their argumets for optimisation and granular controll over what the processor does is not necessary.
Its utterly wrong to push technologies into areas for which they werent originally designed for. We've seen it alot with websites lately and I dont like that embedded is heading the same way!18 -
Fellow Deviants, I need your help in understanding the importance of C++
Okay, I need to clarify a few things:
I am not a beginner or a newbie who has just entered this community...
I have been using C++ for some time and in fact, it was the language which introduced me to the world of programming... Before, I switched to Java, since I found it much better for application development...
I already know about the obvious arguments given in favour of C/C++ like how it is a much more faster and memory efficient than other languages...
But, at the same time, C/C++ exposes us and doesn't protect us from ourselves.. I hope that you understand what I mean to say..
And, I guess that it is a fair tradeoff for the kind of power and control that these languages (C/C++) provide us..
And, I also agree with the fact that it is an language that ideally suits our need, if we wish to deal with compilers, graphics, OS, etc, in the future...
But, what I really want to ask here is:
In this age and times, when hardware has advanced so much, where technically, memory efficiency or execution speeds no longer is the topmost priority... These were the reasons for which C/C++ was initially created...
In today's time, human concept of time matters more and hence, syntactical less complicated languages like Java or Python are much more preferred, especially for domains like application development or data sciences...
So, is continuing with C++, an endeavour worth sticking with in the future or is it not required...
I am talking about this issue since I am in a dilemma about the use of C++ in the future...
I would be grateful if we could talk about keeping AI, Machine Learning or Algorithms Optimisation in mind... Since, these are the fields in which I am interested in...
I know that my question could have been posted in a better way.. But, considering the chaos that is present in my mind, regarding this question doesn't allow me to do so...
Any kind of suggestion or thoughts would be welcome and much appreciated...
P.S: I currently use C++ only for competitive programming or challenges...28 -
Everyone wants faster programs, so doing more optimisations with GCC at -O3 instead of -O2 makes the program quite a bit larger, but... SLOWER. Makes sense, right? Why do you even have -O3 if it generates larger AND slower binaries than -O2?
Ah IC, it's because you use that level only on individual hot functions, not on the full program. How do I do that? Function attribute for optimisation. Cool. Uhm, what is the exact syntax? The fucking GCC documentation doesn't say that. When will devs finally learn to give bloody EXAMPLES?!
Googling around. Ah, with quotes, but without the leading hyphen it seems. Copy/paste. Compile again, tadaa: it's only a little bit but still FUCKING SLOWER than -O2!
GCC's -O3 is like that stupid kid at McD that ate like a damn horse, had to vomit afterwards and was even more hungry than before!13 -
wk48 best question:
My go to question for dev interviews is how do you find all prime numbers from 2 to x because there's so much room for optimisation.
Start with the basics, loop over every number and check if it's divisible by any number less than it, then record the prime numbers and check only those, then move to something like the sieve of eratosthenes then reduce the problem space and only iterate through 2 to sqrt(x)5 -
PM tells me to merge (large feature) work that's heavily under WIP.
In that is a performance optimisation he instructed (with an aggressive DM) me to stop looking at even though it's a concern for larger clients that I had to fix before as it's "unnecessary" - thought whatever I'll leave the code as is then
I tell him him the PR is not ready yet, there is still a lot of clean up to and tests to write
Just do it
A ~week later "wow you write really selfish code like look at this"
Shows a wrapper class from the optimisation with 2 properties and getters and setters (and override some of super's properties). I explain to him why it's there, "that should have been a comment". I tell him I write detailed comments as part of my refinment process which he wanted me to stop.
This is after he tried to merge a release branch into main while sneaking in some "corrections" and I pointed out it breaks Dev.1 -
I'm kind of triggered by all these social media posters and SEO optimizers and "wordpress developers", it's one of the oldest internet scam "jobs" in my eyes where anyone can do what they are doing, yet somehow they are getting paid absurd amounts of money for who knows what. I'm just triggered by how much these people get away with. And stupid ass "companies" that I see all over first google results whose pricing starts from 5k and they're resumes are stock unmodified fucking wordpress themes that cost 39-59 bucks. WHAT THE FUCK. I just want to make a huge wave about this, this is straigh up scaming people. I couldn't live with myself if I would charge this amounts of money for installing a fucking wordpress theme and uploading a few photos. Are you kidding me. And seo scammers? is writting a 200 word essay with fucking yoast seo optimisation worth a few hundred? IS IT?14
-
Last year, we had computers architecture class where we study about the architecture of processors like RISC, CISC, SIMD... The teacher was a nice person but didn't have much knowledge on the field. I read some of Patterson&Hennessey book (computer organisation and design iirc) and learned how to use openmp and mpi, and then in the last lab we were required to optimize matrix multiplication using 4 threads in openmp, the best students optimiseed for 4 times at best, meanwhile I made 16 times optimisation and showed the teacher how fast it was. She was really impressed lol1
-
Snapchat is by far the worst app ever developed. I like the concept but the actual development of the app is fucking garbage. It hurts my head that they haven't given a fuck about usability, optimisation or anything for that matter considering its one of the top social media platforms. It disgusts me, though Instagram has completely ripped off Snapchat in so many ways; they've done a hell of a better job at it and if people weren't so tired to SC I'm sure it would be dead by now.
Slow UI, slow gestures, probably the highest amount of bugs and crashes, shit camera because it thinks it can do a better job than the native API at rendering, painfully slow upload, stupid "featured" stories that you cannot get rid off and slow the fuck out of the app, battery drain even worse than FB, oh and not to forget that once you accidentally enable your location it's impossible to switch it off, the best you can do is hide it from everyone. I can probably go on and on with the endless issues this shit has.5 -
For higher grade software development it should be mandatory to understand the big picture of problems...
If you are working for a online shop, you might want to ask marketing, what they want to sell, before they do it
You might want to ask billing, what customers buy, before you spend time on unnecessary features
You want to ask billing and legals, how they do fraud detection and you want to get the it security fellows on board too.
If marketing and billing knows, that maintenance needs time and money, they can calculate with that. If security knows, that some fails will be catched, no matter if you fix it in software or not they can adapt their priorities.
You might want to know something about process optimisation... Factories of car parts have spent years on such problems - learn from them.2 -
!rant
For the first time, I solved a pretty serious optimisation problem in our codebase without any external input. It's a little thing, but small victories like this are part of what makes the job so much fun for me.
Currently rewarding myself with coffee and chocolate. I feel good! -
#RANT_AHEAD
Almost everyone nowadays uses a PC, Laptop, Smartphone but sadly not even 60% of the total potential of the hardware is being used.
.
And no - you don't require custom cooling to use the whole 100% of the total potential, stock cooling is more than enough.
.
IRL "programmers" these days don't do any fscking effort to optimise their code and give it all up as some kinda shitty "hot patch" - code of their looks disturbing with no security features + optimisation. (wAnBlOwS products remain an example)
.
Even when you're using python you can push your project to limits. Instead of shoving face-size ASCII banners why don't chaps stress test their projects? Oh I forgot the community runs on show-offs and CVs ...
.
Note to Self : Optimisation is the key to integrate Technology with Nature.2 -
Holy shit we finnaly have ChromeOS AVD's!!!
Can't wait to get home and start optimisation and porting! :-D2 -
Love it when you have a SQL query that takes 6.3 seconds (which includes processing time) to execute, and you managed to convert to a process that takes just 0.072 to complete1
-
What are the common problems need to be solved by devs during full stack web development?
My problem is optimisation. -
Possibly my favourite function is Clojure's "recur", which isn't really a function at all, but a special form that gives you a guaranteed tail-position call to the current function.
Basically what that means is you can write recursive functions (functions that call themselves) and know that you're not creating a potential stack overflow.
Um. Okay, I can feel people looking at me like 🤔 Basically what *that* means is: normally when a function calls another function, a "stack frame" is allocated, holding all the local variables for that call. If a function calls itself 1000 times, 1000 stack frames get allocated. "Tail call optimisation" is a process by which if you call yourself as the very last thing in a function, the language doesn't need to remember the current frame; it just has to pass the return value upwards. The trouble is, it's sometimes hard to notice that you've turned a tail-call optimisable function into a non-optimisable one. Clojure's recur keyword makes it explicit, and therefore safe: if you try to do anything with the return value of recur, it's an error.
PS I'm sure another language did explicit TCR first, but Clojure is where I first saw it.6 -
First exam this year, about database optimisation. I have been there just a week and I really enjoy this school
BUT. THIS. CAN'T. BE. TOLERATED.
I wouldn't wish my worst enemy to write SQL on paper goddamnit!!!!
(Yeah I didn't have any other pen that this red one, at least it was erasable)7 -
I've just used https://gtmetrix.com to see how devRant fares. Pretty well actually, with one major gotcha that should be easy to fix. There are a lot of static resources without browser cache expiration date.
A little image optimisation could also be done, see the PageSpeed tab. And scaling down images in CSS could also be replaced by proper scaling of the image itself.
The YSlow tab shows that a little JS minification is missing, and maybe 4 external scripts could be combined into one.1 -
I've always been a strong critic of the mac operating system and apple in general for they're overpriced products. few months back my old laptop kicked the bucket and repairing it was not an option as i was sick of charging the laptop after every 3-4 hours and had to purchase a new laptop immediately. loooking at my options around 50k rs or 700$ all windows laptops available in indian markets sucked (except for lenovo 320s) so i made the shift to macbook air 2017.my daily work involves photoshop illustrator and a dash of premiere pro. I also work on nodeJS and python using the pycharm and atom IDEs. After using it for a month i feel in love with mac platform and macos. Its a wonderful experience. gone are the days of crashes and the windows updates (ugh). the boot of the laptop is like magic and softwares like wmware imovie and notes keynote are f**king awesome. Long hours of work have become fun rather than hell dealing with constant windows gimmicks and bad battery optimisation on linux.
An explanation why all developers (except for the ones who require high powered gpus) graphic designers should shift to macos rn.
Advantages of using mac
No forced updates update whenever now or a f'ing month later no probs.
better battery optimisation than linux
no more installing os again and again (ubuntu)
better vm than virtualbox (vmware)
terminal for running bash commands
no crahes
Xcode platform
trackpad is worlds better than the best windows trackpad
Disadvantages
some softwares not available for macos
storage is generally less on macbooks
UI is simple (less elaborated than windows)
Workarounds
get a vm and install linux(vmware fusion 8)
ps. u may not need it though
wine and wine bottler for using windows apps
get a microsd to sd adapter for macbook and expand storage5 -
The real web development is optimising the shitty front end code.
The task assigned to me is optimisation of dashboard page of website which was developed by freenlancers.(end of contract from their side)
The front end is mess. Individual js files (bootstrap, popper, jQuery, jQuery ui, loader and main) loading in production inside head tag of html file
No text compression.
Every template has random number of their own js files in any block of template. Nothing structured. There will be fantastic waste of time figuring out file dependencies.
Same with css files. Some are scss, some plain css. No compression. No proper modules.
Basically, I have to go through 25-30 html files. Then understand, which template is extending which one. Go through all js and css files in each html file and again understand dependencies between them
This is gonna be real fun.1 -
is being a tech/dev person, a dead end job?
i have been thinking about this for sometime. as a dev, we can progress into senior dev, then tech lead, then staff engineer probably. but that is that. for a tech person :
1. their salary levels are defined. for eg, a junior may earn $10k pm , and the highest tech guy (say staff engineer) will earn $100k pm, but everyone's salary will be spread over this range only, in different slots.
2. some companies give stocks and bonuses , but most of the time that too is fixed to say 30% of the annual salary at max.
3. its a low risk job as a min of x number of tech folks are always required for their tech product to work properly. plus these folks are majorly with similar skills, so 2 react guys can be reduced to 1 but not because of incompetency .
4. even if people are incompetent, our domain is friendly and more like a community learning stuff. we share our knowledge in public domain and try to make things easy to learn for other folks inside and outside the office. this is probably a bad thing too
compare this to businesses , management and sales they have different:
1. thier career progression : saleman > sales team manager> branch manager > multiple branch manager(director) > multiple zones/state manager (president) > multiple countries/ company manager (cxo)
2. their salaries are comission based. they get a commission in the number of sales they get, later theybget comission in the sales of their team> their branch > their zone and finally in company's total revenue. this leads to very meagre number in salaries, but a very major and mostly consistent and handsome number in commission. that is why their salaries ranges from $2k pm to $2-$3millions per month.
3. in sales/management , their is a always a room for optimisation . if a guy is selling less products, than another guy, he could be fired and leads could be given to other/new person. managers can optimise the cost/expenses chain and help company generate wider profits. overall everyone is running for (a) to get an incentive and (b) to dodge their boss's axe.
4. this makes it a cut-throat and a network-first domain. people are arrogant and selfish, and have their own special tricks and tactics to ensure their value.
as a manager , you don't go around sharing the stories on how you got apple to partner with foxconn for every iphone manufacturing, you just enjoy the big fat bonus check and awe of inspiration that your junior interns make.
this sound a little bad , but on the contrary , this involves being a people person and a social animal. i remember one example from the office web series, where different sales people would have different strategies for getting a business: Michael would go wild, Stanley would connect with people of his race, and Phyllis would dress up like a client's wife.
in real life too, i have seen people using various social cues to get business. the guy from whom we bought our car, he was so friendly with my dad, i once thought that they are some long lost brothers.
this makes me wonder : are sales/mgmt people being better at being entrepreneur and human beings than we devs?
in terms of ethics, i don't think that people who are defining their life around comissions and cut throat races to be friendly or supportive beings. but at the same time, they would be connecting with people and their real problems, so they might become more helpful than their friends/relatives and other "good people" ?
Additionally, the skills of sales/mgmt translate directly to entrepreneurship, so every good salesman/manager is a billionaire in making. whereas we devs are just being peas in a pod , debating on next big npm package and trying to manage taxes on our already meagre , "consistent" income :/
mann i want some people skills like these guys10 -
Why would anyone want to run Laravel when it runs so much slower than raw PHP? Surely the development time saved is negated by the amount of optimisation work required?4
-
Before I started working, I used to feel like I depended on documentation and the internet a little too much owing to ultra crappy long term memory. After spending some time at my internship going through code written by "professional developers" several years senior to me and trying to write unit tests for it (surprise: the code was in production without having underwent any sort of testing), I feel like the amount of time I spend online reading usage recommendations, alternates for optimisation, best practices for writing clean and descriptive code and all that is a lot more rewarding. Some bad things help you feel good about yourself.
-
2GB of RAM on my iPhone makes things run smoother than 6GB on my Android.... I used to think more is better... My whole life was a lie8
-
Everyone who runs tests on our platform complains about the speed and says that it needs to be optimised ASAP. Then assumes someone else will do it. Then a few weeks later they complain again!
Vicious cycle...Vicious cycle! -
PHP dev help/advice needed!
We have problems with mysql. Still stuck with mariaDB, I'm using indexes (correct ones) and we have problems with scaling. we have a few tables with over 100mil rows, 1 of them is being read every morning with a subselect that counts unique rows, and fails every time because of timeout/lock, the temp table size was increased and helped for a little while but as time goes on the table grows and the problem reappears. I'm reading from a slave server that was purposely created for read only, yet we still have problems. We're using managed dedicated servers for out hosting and they aren't willing to optimise the database configs for our needs. What are the easiest options for scaling at this point? Going fully dedicated server and perconaDB? NOsql? Sharding the server? Anyone got any good blogposts or something to read about this? your own experience?11 -
Spent hours optimizing code for performance, only to realize it runs slower than a snail on tranquilizers.
-
Hire are a few tips to up productivity on development which has worked for me:
1) Use a system of at least 16gb ram when writing codes that requires compilation to run.
2) Test your code at most 3 times within an hour. This will combat the bad habit of practically checking changes on every new block you write.
3) Use internet modem in place of mobile hotspot and keep mobile data switched off. This will combat interruptions from your IM contacts and temptations to check your WA status update when working.
4) Implementation before optimisation... This is really important. It's tempting to rewrite a whole block even when other task are pending. If it works just leave it as is and move on to the next bull to kill, you can come back later to optimise.
5) Understand that no language is the best. Sometimes folks claim that PHP is faster than python. Okay I say but let's place a bet and I'll write a python code 10 times faster than your PHP on holiday. Focus more on your skill-set than the language else you'd find yourself switching frameworks more than necessary.
6) Check for existing code before writing an implementation from scratch... I bet you 50 bucks to your 10 someone already wrote that.
7) If it fails the first and then the second time... Don't try the third, check on StackOverflow for similar challenge.
8) When working with testers always ask for reproducible steps... Don't just start fixing bugs because sometimes their explanation looks like a bug when other times it's not and you can end up fixing what's never there.
9) If you're a tester always ask for explanations from the dev before calling a bug... It will save both your time and everybody's.
10) Don't be adamant to switching IDE... VSCode is much productive than Notepad++. Just give it a try an see for yourself.
My 10 cents.1 -
One of the worst practices in programming is misusing exceptions to send messages.
This from the node manual for example:
> fsPromises.access(path[, mode])
> fsPromises.access('/etc/passwd', fs.constants.R_OK | fs.constants.W_OK)
> .then(() => console.log('can access'))
> .catch(() => console.error('cannot access'));
I keep seeing people doing this and it's exceptionally bad API design, excusing the pun.
This spec makes assumptions that not being able to access something is an error condition.
This is a mistaken assumption. It should return either true or false unless a genuine IO exception occurred.
It's using an exception to return a result. This is commonly seen with booleans and things that may or may not exist (using an exception instead of null or undefined).
If it returned a boolean then it would be up to me whether or not to throw an exception. They could also add a wrapper such as requireAccess for consistent error exceptions.
If I want to check that a file isn't accessible, for example for security then I need to wrap what would be a simple if statement with try catch all over the place. If I turn on my debugger and try to track any throw exception then they are false positives everywhere.
If I want to check ten files and only fail if none of them are accessible then again this function isn't suited.
I see this everywhere although it coming from a major library is a bit sad.
This may be because the underlying libraries are C which is a bit funky with error handling, there's at least a reason to sometimes squash errors and results together (IE, optimisation). I suspect the exception is being used because under the hood error codes are also used and it's trying to use throwing an exception to give the different codes but doesn't exist and bad permissions might not be an error condition or one requiring an exception.
Yet this is still the bane of my existence. Bad error handling everywhere including the other way around (things that should always be errors being warnings), in legacy code it's horrendous.6 -
Best eays to improve database performance?
I have a huge database table with a lot of data, 10+columns and around 5-6million rows and growing. We are thinking about optimisation methods, the data will be frequently accessed, but not in the same ways. even though caching is helping, some initial requests take 6-20secs. What are good ways to improve a relational db performance? The data is date and item based, every item can have some data back from 2016 or older and up to 1000 related rows in each day. Every day new data would be added. Right now working with php.8 -
Hi everyone! I'm in need of some help regarding the approach to my bachelor thesis.
The practical stuff is basically clickstream/task and usability analysis on an existing platform and creating mockup improvements for some processes. I was thinking about using a spider to generate a tree (or another datastructure) regarding all the different tasks available and then trying to optimise said tree, thus automatically optimising the processes within. I'm having however issues imagining how this optimisation might be generalised for more than this one platform.
Basically, I'm a bit lost and grasping for any pointers in any direction regarding these ideas.3 -
Do you use i3 (dynamic tiling windows manager) on your *nix system?
What are your favourite tips/hacks for optimisation?8 -
What is the best source for learning x86 asm and binary exploitation? Got any recommendations for me? (books?) I already know godbolt.org I'd also be interested in optimisation.6
-
Need some advise from all you clever devs out there.
When I finished uni I worked for a year at a good company but ultimately I was bored by the topic.
I got a new job at a place that was run by a Hitler wannabee that didn't want to do anything properly including writing tests and any time I improved an area or wrote a test would take me aside to have a go so I quit after 3 months.
Getti g a new job was not that hard but being at companies for short stints was a big issue.
My new job I've been here 3 months again but the code base is a shit hole, no standardisation, no one knows anything about industry standards, no tests again, pull requests that are in name only as clearly broken areas that you comment on get ignored so you might as well not bother, fake agile where all user stories are not user stories and we just lie every sprint about what we finished, no estimates and so forth, and a code base that is such a piece of shit that to add a new feature you have to hack every time. The project only started a few months back.
For instance we were implementing permissions and roles. My team lead does the table design. I spent 4 hours trying to convince him it was not fit for purpose and now we have spent a month on this area and we can't even enforce the permissions on the backend so basically they don't exist. This is the tip of the iceberg as this shit happens constantly and the worst thing is even though I say there is a problem we just ignore it so the app will always be insecure.
None of the team knows angular or wants to learn but all our apps use angular..
These are just examples, there is a lot more problems right from agile being run by people that don't understand agile to sending database entities instead of view models to client apps, but not all as some use view models so we just duplicate all the api controllers.
Our angular apps are a huge mess now because I have to keep hacking them since the backend is wrong.
We have a huge architectural problem that will set us back 1 month as we won't be able to actually access functionality and we need to release in 3 months, their solution even understanding my point fully is to ignore it. Legit.
The worst thing is that although my team is not dumb, if you try to explain this stuff to them they either just don't understand what you are saying or don't care.
With all that said I don't think they are even aware of these issues somehow so I dont think it's on purpose, and I do like the people and company, but I have reached the point that I don't give a shit anymore if something is wrong as its just so much easier to stay silent and makes no difference anyway.
I get paid very well, it's close to home and I actually learn a lot since their skill level is so low I have to pick up the slack and do all kinds of things I've never done much of like release management or database optimisation and I like that.
Would you leave and get a new job? -
Persisterising derived values. Often a necessary evil for optimisation or privacy while conflicting with concerns such as auditing.
Password hashing is the common example of a case considered necessary to cover security concerns.
Also often a mistake to store derived values. Some times it can be annoying. Sometimes it can be data loss. Derived values often require careful maintenance otherwise the actual comments in your database for a page is 10 but the stored value for the page record is 9. This becomes very important when dealing with money where eventual consistency might not be enough.
Annoying is when given a and b then c = a + b only b and c are stored so you often have to run things backwards.
Given any processing pipeline such as A -> B -> C with A being original and C final then you technically only need C. This applies to anything.
However, not all steps stay or deflate. Sum of values is an example of deflate. Mapping values is an example of stay. Combining all possible value pairs is inflate, IE, N * N and tends to represent the true termination point for a pipeline as to what can be persisted.
I've quite often seen people exclude original. Some amount of lossy can be alright if it's genuine noise and one way if serving some purpose.
If A is O(N) and C reduces to O(1) then it can seem to make sense to store only C until someone also wants B -> D as well. Technically speaking A is all you ever need to persist to cater to all dependencies.
I've seen every kind of mess with processing chains. People persisting the inflations while still being lossy. Giant chains linear chains where instead items should rely on a common ancestor. Things being applied to only be unapplied. Yes ABCBDBEBCF etc then truncating A happens.
Extreme care needs to be taken with data and future proofing. Excess data you can remove. Missing code can be added. Data however once its gone its gone and your bug is forever.
This doesn't seem to enter the minds of many developers who don't reconcile their execution or processing graphs with entry points, exist points, edge direction, size, persistence, etc.2 -
Question: for my personal project I am looking into android aso (app store optimisation). Any of you has any good recommendations? Things that really work?