lievikoff

Experience

11,460

0 Best Reply Awards

  • Member Since 1 Month Ago
  • 111 Lessons Completed
  • 0 Favorites

11th August, 2018

lievikoff left a reply on Instantiating Objects • 1 week ago

@youkaihiei thanks. Are there benefits of passing as arguments?

10th August, 2018

lievikoff left a reply on Instantiating Objects • 1 week ago

@PatrickL Thank you for your reply. The code is just an example of the approx implementation. That is more a code design question. I am not sure what is the best OOP approach when you build classes.

lievikoff started a new conversation Instantiating Objects • 1 week ago

I am confused with instantiating object in PHP.

I have this files:

  • Index.php (Actually WordPress plugin's main file but let's stick with index.php)
  • autoloader.php (A custom autoloader because of custom standards)
  • src/Plugin.php (It supposed to have everything i need for the core like versions, paths etc)
  • src/FrontendScripts.php (It extends a Scripts class and implements a Hook interface)
  • src/BackendScripts.php (It extends a Scripts class and implements a Hook interface)

In index file i do:

$autoloader = new Autoloder();
$autoloader->register();

// so here i can use any of those classes without require them manually.

$plugin = Plugin::getInstance();

$frontend_scripts = new FrontendScripts( 'app', 'test' ); // list of script names that should be registered

$backend_scripts = new BackendScripts( 'admin' ); // the same as for frontend

What is the best practice of instantiating those FrontendScripts and BackendScripts objects? Should i pass them to the main plugin class as args? Should i just make instances inside the Plugin class without any arguments passed to the main class?

lievikoff left a reply on 15" MacBook Pro Alternatives • 1 week ago

I got a MBP 13" - that is a perfect machine for coding. I don't feel like i need more display space. Thank you all for replies.

30th July, 2018

lievikoff started a new conversation How Do You Deal With Project Structure, Naming, And Code Organizing As Well? • 3 weeks ago

Hi.

I always have problems with structure my projects or naming files/methods/functions. This happens because i want to keep it as much maintainable as possible. I had experience in supporting some projects that should be long term but they created on a knee and not by me. I know how terrible might be supporting those bad smell code. I caught myself spending a lot of time thinking about how to structure a project or name methods.

I assume that happens because of missing experience in code design or useless perfectionism.

How do you deal with that? Are there any good books you can recommend about code design or how to get rid of code perfectionism?

A quick example:

I am currently working on a WordPress Plugin that supposed to work with ReactJS. And here it goes...

Should i make src/dist folders or just keep things like assets/js assets/jsx assets/css assets/scss and then exclude those sources folders from a production version etc.

28th July, 2018

lievikoff left a reply on MacBook Pro Alternatives • 3 weeks ago

@brightstormhq I had never seen MBP 13" in real life so thank you for sharing your experience! I will try and get one.

lievikoff left a reply on MacBook Pro Alternatives • 3 weeks ago

@ohffs thank you. Then i will just buy a MBP 13".

lievikoff left a reply on MacBook Pro Alternatives • 3 weeks ago

@brightstormhq I agree with you about MBP 13" power. That is quite enough for me. The only thing i am not sure is the screen size. Do you think 13" would be enough for coding without an external monitor? Unfortunately, where i live, there is no apple store to see it in real life and test.

27th July, 2018

lievikoff started a new conversation MacBook Pro Alternatives • 3 weeks ago

Hi!

I used to work on MacBook Pro 15” but it is no longer with me. Unfortunately, I don’t have enough money to buy a new one.

Maximum what I can buy is MacBook Air 13” minimal specification.

Should I give up on Mac OS and love windows?

Is there possible alternatives for budged in $1000?

The main requirements:

  • a nice screen
  • not a crazy touchpad which is most not apple laptops have
  • keyboard that not “crying” when typing
  • SSD

21st July, 2018

lievikoff started a new conversation Namespaces In PHP And The Same Name Classes • 1 month ago

Hi. Could you please help me understand best practice of naming classes in PHP using namespaces?

Example: We have two classes called the same - "Assets" but they have different namespaces: App and App/Admin.

Code:

  • app/assets.php (supposed to enqueue frontend assets):
Edit Your Profile
Update

Want to change your profile photo? We pull from gravatar.com.